How to Stop a Loop if a Specific Step Fails or is Skipped

Overview

In certain test scenarios, you may need to exit a loop prematurely if a specific step within that loop fails to execute or is skipped. This can be achieved by using a conditional Break action to control the loop's flow.

How It Works

The Break action provides a way to exit a loop when a defined condition is satisfied. To stop a loop if a particular step does not run, you can configure a Break action to be dependent on that step.

  1. Place a Break action within the loop you wish to control. This can be done easily using the Quick Add functionality.
  2. Position the Break action after the critical step that determines if the loop should continue.
  3. Configure the Break action to be dependent on the critical step.
  4. With this dependency, if the critical step is skipped or fails, the condition for the Break action is met.
  5. When the Break action executes, it will immediately exit the loop and the test will proceed to the steps following the Loop End action.

Limitations

The Break action must be placed inside the loop that it is intended to exit.

Related Info

The Break action is part of the loop control structure, which also includes the Loop Start and Loop End actions. Actions can be added quickly to a test case using the Quick Add feature.