Page 1 of 1

Exception Handling

Posted: Wed Aug 21, 2013 9:15 pm
by narmand
I have a data driven recording module that iterates through a number of test cases based on the data in my excel file. There are situations in which during the execution a error may occur or synchonization issue may appear and the test is not longer in sync. I tried to look at all the possible errors and add user code to verify they exist but there are too many to try and account for. Then I started looking at if an error occurs have ranorex shut down IE and restart. That worked using the Error handling options from the test case settings. I have a sibling test that will close IE and logging in to my application. Here's my problem, how do I go about continuing the test from the next iteration?

Re: Exception Handling

Posted: Thu Aug 22, 2013 8:09 am
by odklizec
I'm not quite sure about the structure of your test suite, but basically, an option could be to restart the data driven test case with a new data range, starting from the last failed item, or the next item after the failing one?

In other words, in your error handling procedure, store the actual (failing) iteration number and then restart the data range test case with new range. See my post here how to set the data range from code...
http://www.ranorex.com/forum/setting-da ... tml#p21010

The only downside of this solution is that the progress bar of running test will show you incorrect data range. This is a known (reported and scheduled to fix) RX bug. Hope this helps?

Re: Exception Handling

Posted: Fri Aug 23, 2013 3:44 pm
by Support Team
Hi,

If I got this correctly you want to continue with the iteration when an error occurs.
In order to continue you could also set the error behavior of the test case to "Continue with iteration" and in order to handle the case when something goes wrong you can add a module to the teardown section of the test case, since the module which is located in the teardown will be executed even if an error occurs.
For more information about the sections and error behavior please take a look at the following UserGuide section: Lesson 4: Ranorex Test Suite.

Regards,
Markus

Re: Exception Handling

Posted: Fri Aug 23, 2013 6:48 pm
by narmand
I think the first suggestion may work, since there are so may exception types, I just want to shutdown to browser and restart. then i can have it continue from the next line.

thanks that will work!