Ranorex exception handling

Ask general questions here.
rcd.guerra
Posts: 29
Joined: Tue Mar 03, 2009 11:43 pm

Ranorex exception handling

Post by rcd.guerra » Fri Mar 06, 2009 5:11 pm

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

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Post by Ciege » Fri Mar 06, 2009 5:23 pm

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?

rcd.guerra
Posts: 29
Joined: Tue Mar 03, 2009 11:43 pm

Post by rcd.guerra » Mon Mar 09, 2009 11:01 am

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

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Post by Ciege » Mon Mar 09, 2009 4:23 pm

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.

rcd.guerra
Posts: 29
Joined: Tue Mar 03, 2009 11:43 pm

Post by rcd.guerra » Mon Mar 09, 2009 7:07 pm

Ok,

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

Thanks

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Post by Ciege » Mon Mar 09, 2009 7:12 pm

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.