Handling the Error 'The test run has stopped because the Stop on Error (Warning) setting is enabled.'

Applies to TestComplete 12.60, last modified on September 17, 2018

About the Message

Tests post different kinds of messages to the test log. TestComplete includes the Stop on error setting that controls whether the test run stops once an error message is posted to the log.

Diagnosing the Problem

  1. Open the test log and locate the “The test run has stopped...” message in it.

  2. The “The test run has stopped...” message is posted right after an error is posted to the log. So, to see what event caused the “The test run has stopped...” message, just look at the previous message in the log.

  3. Examine the description that is shown in the Additional Info panel for the problematic message to understand the cause of the problem.

    To view the test commands that posted the error message, double-click that message in the test log. TestComplete will open the test containing the problematic command and will highlight that command in the test.

Resolving the Problem

By default, tests use commands that post errors if they are unable to find the needed object. For instance, if a test command returns a test process or window and that process or window does not exist, the command posts an error message informing about the problem.

For example, the following code snippet activates a form of a tested application:

JavaScript, JScript

Aliases.MyApp.Form1.Activate();
// OR
Sys.Process("MyApp").Window("Form1").Activate();

Python

  Aliases.MyApp.Form1.Activate();
  # OR
  Sys.Process("MyApp").Window("Form1").Activate();

VBScript

Aliases.MyApp.Form1.Activate
' OR
Sys.Process("MyApp").Window("Form1").Activate

DelphiScript

Aliases.MyApp.Form1.Activate();
// OR
Sys.Process('MyApp').Window('Form1').Activate();

C++Script, C#Script

Aliases["MyApp"]["Form1"]("Activate")();
// OR
Sys["Process"]("MyApp")["Window"]("Form1")["Activate"]();

If the tested application is not running, or if the tested form does not exist at the moment of the call, this statement causes the “Object Not Found” error. If you have the Stop on error setting enabled in your project, the test run will stop.

To avoid this problem, you can do the following --

  • (Recommended) Change your test so that it waits for the needed objects and handles the cases when these objects are not available.

    The way you do this depends on the test type. For complete information, see the following topics:

  • Disable the Stop on Error project setting. You may want to do this if you do not want the test run to stop when an error occurs.

    To disable the setting, right-click your project in the Project Explorer panel and choose Edit | Properties from the context menu. This will open the project editor. On the Properties page of the project editor, select the Playback category on the left and clear the Stop on error check box on the right.

See Also

Handling Playback Errors
Working With Application Objects and Controls - Common Tasks
Stopping Tests on Errors and Exceptions - Overview

Highlight search results