more verbose exit status on FAILED?

Class library usage, coding and language questions.
jasong
Posts: 49
Joined: Fri Oct 26, 2007 9:38 pm
Location: Texas

more verbose exit status on FAILED?

Post by jasong » Wed Oct 31, 2007 7:31 pm

Is it possible to receive more verbose failure information than just 'FAILED'?
Some good bits of information would be the exception, control the error appeared with, and the action attempted.

Jason

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

Post by Support Team » Fri Nov 02, 2007 10:10 am

I assume that you mean the code generated by the RanorexRecorder. By default the generated code does not include any error checks nor status loggings.

Of course you can easily extend the generated code, check the return value of methods and print log statements if they have failed.

We're currently discussing how to improve logging in future versions.

Regards,

Alex
Ranorex Support Team
Last edited by Support Team on Thu Nov 08, 2007 1:34 pm, edited 1 time in total.

jasong
Posts: 49
Joined: Fri Oct 26, 2007 9:38 pm
Location: Texas

a Pythonic way to deal with failures

Post by jasong » Tue Nov 06, 2007 1:33 am

A good Pythonic way to deal with this would be to create a set of exceptions that act as your messengers.

Put each action (e.g. mouseclick) inside a try clause and test for the various exceptions that could be generated by that action. This gives an extreme amount of power to the script writer and tester to be able to not just receive better information but how to optionally handle it.

Logging (and I recommend using the Python logging module) is a way to capitalize on all of this.

Keep up the good work!

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

Post by Support Team » Tue Nov 06, 2007 9:49 am

Thank you for your feedback! We will consider your suggestions for the next feature prioritization.

Regards,

Alex
Ranorex Support Team

jasong
Posts: 49
Joined: Fri Oct 26, 2007 9:38 pm
Location: Texas

Post by jasong » Wed Nov 07, 2007 6:54 pm

How specifically could I return results that would appear in the Recorder?

For example 'Can not find <control>'

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

Post by Support Team » Thu Nov 08, 2007 1:43 pm

Just check the return value of the corresponding Ranorex method and print information about the error.

E.g. if the generated script calls the

Code: Select all

RanorexPython.FormFindChildControlName(hWndForm, controlName)
method, check if the return value is zero. If so, print out a message like "Cannot find control 'controlName'.".

Alex
Ranorex Support Team