3.13.1. Overview of Conditional Statements and Loops
Prev | 3.13. Working with Conditional Statements and Loops | Next

### 3.13.1. Overview of Conditional Statements and Loops

There are four special nodes for altering normal test execution, called Controllers:

- Conditional Statements (If - Then - Else)

- Do - While loops

- While - Do loops

- Repeat loops

You can add the nodes to Test Cases through the Add submenu of the context menu in a Test Case Editor.

These nodes have a fixed list of children (so-called Containers) which in turn can contain only non-Controller nodes (so they can contain only Test Steps, Test Case References and Comments).

Conditional Statements, Do - While loops and While - Do loops have a Condition child (called While for the latter two) whose behavior is the following:

- Conditions cannot be empty, so they must always contain at least one active node.

- Conditions are determined by Checks. So a Condition is considered to be false as soon as such a Check Fail is encountered in any of its children which is not handled by a Check Fail handler. If a Condition (and its executed children) does not contain any Checks, then it is considered to be false.

For example in the following IfThenElse Test Case, the Condition references a Test Case which has its own Handler for Check Fails, so even if the actual Check in that Test Case fails, this failure will be caught by the Handler, so it will not make the Condition to become false.

Figure 3.22. A sample Condition

Test Result Nodes corresponding to Test Steps making a Condition fail are marked by error markers, but these markers are not propagated up to their ancestors.