Exception Handling

Ask general questions here.
narmand
Posts: 13
Joined: Thu Mar 21, 2013 11:20 pm

Exception Handling

Post by narmand » Wed Aug 21, 2013 9:15 pm

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?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Exception Handling

Post by odklizec » Thu Aug 22, 2013 8:09 am

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Exception Handling

Post by Support Team » Fri Aug 23, 2013 3:44 pm

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
.
Image

narmand
Posts: 13
Joined: Thu Mar 21, 2013 11:20 pm

Re: Exception Handling

Post by narmand » Fri Aug 23, 2013 6:48 pm

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!