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.
- Place a
Breakaction within the loop you wish to control. This can be done easily using the Quick Add functionality. - Position the
Breakaction after the critical step that determines if the loop should continue. - Configure the
Breakaction to be dependent on the critical step. - With this dependency, if the critical step is skipped or fails, the condition for the Break action is met.
- 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.