Page 1 of 1

Ranorex exception handling

Posted: Fri Mar 06, 2009 5:11 pm
by rcd.guerra
Hi there,

We are evaluating the tool and want to know if there is any guideline to approach exception handling in Ranorex ?

Our scenario is the following:
- the user performs a click on some button.
- if the requested operation fails an error dialog is shown.

For us to be able to know an exception was thrown, we only have to find the error dialog or there is a better option ?

Thanks in advance!

Cheers,
Ricardo

Posted: Fri Mar 06, 2009 5:23 pm
by Ciege
Is the exception (or error) that you want to trap coming from your AUT or from Ranorex (i.e. the button was not found or was not clickable)?

If the former then I would believe that additional code on your part to check for the warning or error is needed.

If the latter, can you not just do a Try/Catch block and Catch RanorexException?

Posted: Mon Mar 09, 2009 11:01 am
by rcd.guerra
Thanks for your reply Ciege.

Its the former.

Lets say the clicking a button fires a server operation and that one throws an exception to the client.

In our scenario, in any scenario the exception would be caught and wrapped in a error dialog. If i see the error dialog has been displayed its enough ?

Thanks!

Cheers,
Ricardo

Posted: Mon Mar 09, 2009 4:23 pm
by Ciege
That should be enough. Add some code to your automation that after the click checks for this error dialog. If it doesn’t occur after say 10 seconds, then continue your test. If the dialog does occur, throw an error in your test script.

Posted: Mon Mar 09, 2009 7:07 pm
by rcd.guerra
Ok,

i guess that could be an option but the timeout is pretty much variable.

Thanks

Posted: Mon Mar 09, 2009 7:12 pm
by Ciege
Yes, 10 seconds is variable. Set that timeout to however long you want to wait to check if the error dialog appears. If it does appear do something, else if it doesn't appear, continue with your script.