Hi,
that code works but the following does not: |
The only difference with my code is the line below:
// do something that triggers an error of the Jscript engine, eg a timeout
Could you please decrypt this comment so I can understand what kind of error you are getting?
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. |
The solution is to use the 'try..catch' block.
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. |
The description of the exception is posted to the Remarks pane. Just select the corresponding error message in the test log, and you will see the description of the exception in Remarks. If you need to get more information, just post this information to the call of the Log.Error method. You can find information on the properties of the Error object in
this MSDN Library article.
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? |
TestComplete never raises exceptions. The tool can post errors to the log. Some kind of errors can be handled in a specific way, and you can set this up in the Playback group of the project properties editor.