Sometimes when an error occurs or a test fails, the proper reaction is to abandon execution of the current iteration of a loop, or the whole loop. This is supported by way of two specialized error handling options.

Next Iteration

In the following robot, step B has error handling "Next Iteration". This means that if an error occurs during execution of this step, execution of the current iteration of the loop is stopped. Thus neither step C nor step D will be executed; instead execution continues at step A with a robot state that reflects the next tag among those that the loop step iterates over.

This error handling option is a kind of shortcut, as the same effect can be achieved with the aid of "Try Next Alternative" and a Try step in the following way:

Note that doing this transformation in general requires use of "At" Targets because other Try steps may interfere.

If the robot contains several loops steps after each other, it is possible to select the one in which to go to the next iteration. This is described in "At" Target.

"Next Iteration" does not work with Repeat-Next loops. The word "next" has very different implications for the browser state in these two cases.

Break Loop

Instead of completing a single iteration of the loop with "Next Iteration", the whole loop may be aborted with "Break Loop" as follows:

Also this error handling option is a kind of shortcut. The following robot will have the same effect:

Note that "Break Loop" does work with Repeat-Next loops, as opposed to "Next Iteration".