Unattended execution

Experiences, small talk, and other automation gossip.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Unattended execution

Post by omayer » Thu Sep 20, 2012 5:08 pm

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
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Unattended execution

Post by Support Team » Fri Sep 21, 2012 8:41 am

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

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Unattended execution

Post by omayer » Sat Sep 22, 2012 6:34 am

I sent the sample project via mail
Tipu

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Unattended execution

Post by artur_gadomski » Mon Sep 24, 2012 6:59 am

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.

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Unattended execution

Post by omayer » Wed Sep 26, 2012 2:38 pm

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
Tipu

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Unattended execution

Post by artur_gadomski » Thu Sep 27, 2012 6:52 am

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.

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Unattended execution

Post by omayer » Fri Sep 28, 2012 4:48 am

Thank you again, it worked after using try catch before each method call and i changed error behavior continue with sibling
Tipu

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Unattended execution

Post by omayer » Wed Oct 31, 2012 6:10 pm

when error catches it doesn't tell me where is the error happenned , how do i get that called, Thank you in advance
Tipu

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

Re: Unattended execution

Post by Ciege » Wed Oct 31, 2012 6:21 pm

Report the exception message to the log and it will tell you what happened.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...