Page 1 of 1

Unattended execution

Posted: Thu Sep 20, 2012 5:08 pm
by omayer
Here is my scenario --ranroex 3.3.2, ie7
I have a console prompt to enter groupid which contains around 10 scenarios, after enterring the groupid in console prompt- function query the groupid and scenarioid in sqldb then execute the scenario and write the result like company id to result table in sqldb,
The problem i am running into when anything breaks on script either object not found or apps got hung up or bad data, the test execution got stoppe and i have to kickoff manually from the beginning,
Please advise how can i handle the error to continue the test execution with the next scenario and abondon the scenario that causing the error
- i do have a column on resulttable that track which scenario and which script ahs last finished

Re: Unattended execution

Posted: Fri Sep 21, 2012 8:41 am
by Support Team
Hi,

as already mentioned in the mail, can you please provide us your test project, or a sample project which sketches the behavior of your original project?
Without this information it’s very hard for us to provide useful suggestions for you.
You can either attach the solution to your next forum post, or send it via mail.

Regards,
Tobias
Ranorex Team

Re: Unattended execution

Posted: Sat Sep 22, 2012 6:34 am
by omayer
I sent the sample project via mail

Re: Unattended execution

Posted: Mon Sep 24, 2012 6:59 am
by artur_gadomski
Use try catch to catch any exceptions on one run, then clean up so that next run can be started (this is a tricky part as you don't know in what state your AUT was left, if you can just close AUT and open it again that's easier), run next scenario.

Re: Unattended execution

Posted: Wed Sep 26, 2012 2:38 pm
by omayer
Thank you artur_gadomski, does try catch work even i do have validate.exist most of the functions, should i replace validate exist with try catch., i do have around 700 functions that runs in one scenarios.
Thank you again

Re: Unattended execution

Posted: Thu Sep 27, 2012 6:52 am
by artur_gadomski
I was more sugesting to make a general try catch around whole scenario. This would catch all exceptions and then you can clean up and prepare for next scenario. Technically every line that manipulates Ranorex Adapters like Button.Click() can throw exception if that button is not found or something else happens. When writing our code we try to be reasonable: make sure form exists, by checking form or a button on the form for existance, then we assume that all other controls on this form exist also. But that sometimes leaves us with unhandled exceptions, which we catch in general try catch around whole test.

Re: Unattended execution

Posted: Fri Sep 28, 2012 4:48 am
by omayer
Thank you again, it worked after using try catch before each method call and i changed error behavior continue with sibling

Re: Unattended execution

Posted: Wed Oct 31, 2012 6:10 pm
by omayer
when error catches it doesn't tell me where is the error happenned , how do i get that called, Thank you in advance

Re: Unattended execution

Posted: Wed Oct 31, 2012 6:21 pm
by Ciege
Report the exception message to the log and it will tell you what happened.