Occurs when a test run is over.
Occurs when TestComplete stops running a test, namely --
You can create an
OnStopTest event handler to perform actions after the test execution is finished. For instance, the event handler can play sounds to indicate that the test execution has finished.
The event has the following parameter:
The Event control that processes the event.
It is not recommended to use global variables in the
OnStopTest event handler. Typically, the scripting engine raises the
OnStopTest event when these variables already have been cleared and are not available to your scripts. To avoid possible issues, we recommend that you use project variables rather than global script variables in
OnStopTest event handlers.
Note for JScript, C++Script and C#Script users: Since the test script finishes by the moment the
OnStopTest event handler starts, the objects created by the script become invalid. If you store a reference to an object in a global script variable or in a project variable, it will refer to an invalid object and your script will cause the Can't execute code from a freed script error, even if the object is not null.
To work around the issue, create the object anew within your handler routine. If the object contains data that you need to use, you need to save this data to project variables, file or some external COM object.
OnStopTest event is not generated if the test is stopped right after it has begun. Also, the
OnStopTest is not generated in Connected Applications.
In all other cases, the
OnStopTest event is generated when the test run is finished. For instance, if --
In addition, do not call the
NetworkSuite.Synchronize method from the event handler. The method will always return False.