Page 1 of 1

BUG - Error behavior not working correctly

Posted: Mon Jun 01, 2015 3:47 pm
by krstcs
Ranorex 5.3.2
Windows 7

Setting a testcase to use "Continue with sibling" under Error Behavior acts like "Continue with iteration".

Instead of stopping the testcase and moving to the testcase's next sibling, the testcase continues with the next module after the failure. The user guide says that "Continue with sibling" should "in case of an error, the currently running test case should break and the execution should continue with the sibling test case" but this is not happening.

I have created and attached a test suite that demonstrates the issue.

Suite Error Behavior and nested test cases

Posted: Mon Jun 01, 2015 4:03 pm
by krstcs
I just posted a bug (http://www.ranorex.com/forum/bug-error- ... t8037.html) about error behavior, but while researching that issue I realized that I had a related question about how the errors are supposed to be propagated back up the stack of testcases.

My expectation is that if I set both a child testcase and it's parent testcase to "Continue with Parent" that the child's failure would propagate up to the parent and then up to the grandparent. But I'm not sure this is correct. Would the parent's run continue, or should it stop as well?

Code: Select all

TC_Grandparent -> 'Continue with sibling'
--TC_Parent -> 'Continue with parent'
----TC_Child1 -> 'Continue with parent'
------Module1 -> Fails here...  This should keep Module2 from running and TC_Child2 should not be run because parent is also set to 'Continue with parent'
------Module2 -> Should not be run
----TC_Child2 -> 'Continue with parent'
------Module3
Is this correct?

Not, I'm asking what SHOULD happen, not what does happen. The bug I posted above seems to be causing side-effects with this, so I wanted to know how it is intended to work.

Re: BUG - Error behavior not working correctly

Posted: Tue Jun 02, 2015 8:04 am
by Support Team
Hello krstcs,

Report.Failure does not actually throw an exception, but rather marks the module as failed. This is by design. Please replace the Report.Failure with an exception or a validation which fails. The error behavior works as expected, please find a sample report attached.
My expectation is that if I set both a child testcase and it's parent testcase to "Continue with Parent" that the child's failure would propagate up to the parent and then up to the grandparent.
This is absolutely correct.

Hope this information helps. Within this scenario the test would continue with "TC_Grandparent2".

Regards,
Robert

Re: BUG - Error behavior not working correctly

Posted: Tue Jun 02, 2015 1:53 pm
by krstcs
Ah! OK, that makes sense. I did think that it threw an exception.

Thanks Robert!