Exception handling
Hi,
how can exceptions that are raised by Testcomplete be correctly handled?
At sporadic intervals the execution of my Jscript testscript is interrupted and Testcomplete displays a modal dialog box:
"An exception occurred in the "Foo" unit at line 12: This operation returned because the timeout period expired."
The test execution is stopped, I have to acknowledge this dialog with OK and then I have to restart the test execution from scratch.
This usually happens while trying to use the slice() method on the caption of a component. The application puts the system under a heavy load, so maybe the component just isn't ready at that time, I don't know. My question is: How can I tell Testcomplete to just move on? I don't want my whole test run to be stopped just because a caption cannot be read.
I tried to put a try-catch block around the calls in Foo:
funcation Foo()
{
try
{
// do stuff
}
catch(exception)
{
Log.Error("Exception", exception.description);
}
}
However now a) the test run is still stopped and b) I don't get any information about why the test stopped anymore. "exception.description" is empty!
How can a) and b) be solved, so that Testcomplete writes whatever problem it encounters to the log and then continues with the test run?
Thanks!
The project options look like this: