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
more verbose exit status on FAILED?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
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
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.
a Pythonic way to deal with failures
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!
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!
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Just check the return value of the corresponding Ranorex method and print information about the error.
E.g. if the generated script calls themethod, check if the return value is zero. If so, print out a message like "Cannot find control 'controlName'.".
Alex
Ranorex Support Team
E.g. if the generated script calls the
Code: Select all
RanorexPython.FormFindChildControlName(hWndForm, controlName)
Alex
Ranorex Support Team