When you run tests (either test items specified on the Execution Plan editor or from the command line), by default, if an error occurs, TestComplete stops the entire project right after an error message is posted to the test log. It does not execute any other tests.
Sometimes you may need to change the default behavior to command TestComplete to rerun an unstable test item and then continue running the entire project. You can do it in one of the following ways:
Currently, the rerunning of BDD feature files is not supported.
In the Execution Plan editor of your project, make sure that the On error property of a test item is set to Use project’s 'On error' property:
On the Properties page of your project, set the Playback> Error handling > On error property of your project to Stop and rerun current item. Use the Rerun failed test items property to set the number of retries for failed test items:
In the Execution Plan editor of your project, set the On error property of your test item to Stop and rerun current item:
Note: The test item will ignore the Error handling > On error property of your project.
On the Properties page of your project, specify the number of retries for failed test items by using the Playback> Error handling > Rerun failed test items property:
When you run your project and an error occurs in a test, TestComplete will rerun the problematic test item until it passes or until the maximum number of retries that the project’s Rerun failed test items property specifies is reached.
If a retry passes successfully or with warnings, TestComplete will mark this test item as successful or warning respectively and add info about the number of retries to the Summary report.
If all rerun attempts fail, TestComplete will mark the test item as failed and proceed with the next test item.
Detailed information about successful retries is shown in the Warning and Passed tabs. By default, this information is grouped into a collapsed list marked with the icon for each rerun test item. You can expand such lists to obtain more information about each retry:
Exit codes for rerun tests
If your tests are run automatically (for example, by using the command line or from a CI system like Jenkins), you may want to get and analyze the TestComplete exit code to check whether your test run has passed or failed.
If your TestComplete project is configured to rerun failed test items, the exit code that TestComplete returns corresponds to the test session status you see in the Summary report. For instance, if a test item fails and then reruns successfully, the exit code will specify that the test session has been successful.