Hi,
that code works but the following does not:
function Foo()
{
try
{
throw new Error(-1, "test exception");
// do something that triggers an error of the Jscript engine, eg a timeout
}
catch(exception)
{
Log.Error("Exception", exception.description);
}
Log.Message("OK");
}
You wrote that it is impossible to tell Testcomplete to continue test execution after an error of the Jscript engine, so the statement "Log.Message("OK");" will never be executed. That makes unattended tests difficult, but "impossible" sounds as if there's currently no way to solve that problem.
However there's another problem: The try-catch block now correctly catches the "test exception" but it also eats the Jscript error statement. That means when the error of the Jscript engine occurs, test execution just stops and nothing happens anymore. There is no error dialog, no error details and no line number where the error happened. All I get is the word "Exception" in the log, which is not really helpful. On the other hand, if I leave out the try catch block, I get all the details about the Jscript error in a popup dialog, but then the Testcomplete error aren't catched anymore either.
Is there a way to configure the catch statement so that it either only catches exceptions raised by Testcomplete and not by the Jscript engine, or to make it display some details about the Jscript error?
Thanks.