Repetition Logic

Repetition logic repeats a sequence of test steps a set number of times while or until a user-defined condition is true. The condition used in repetition logic compares two values and returns a value based on the comparison. For more information, see Condition Designer. The values in the condition can be either the value of a property of a control in the test application, the value of a variable used in the visual test, a literal value, or a value from an ActiveData asset.

Repetition logic that repeats a sequence of test steps a set number of times consists of the following elements:

Repeat <number of times>
  __<Run sequence of test steps> 
End Repeat

For example, the sequence of test steps in the following repetition logic is repeated from step 10 to step 15:

Repeat 10 times
  __Do step 10
  __To step 15   
End If          

Repetition logic that repeats a sequence of test steps while, or until a user-defined condition is true consists of the following elements:

Repeat while <condition=TRUE>
  __<Run sequence of test steps>
End Repeat

Or, you can specify the condition at the end of the loop:

Repeat
  __<Run sequence of test steps>
End Repeat while <condition=TRUE> 

For example, the sequence of test steps in the following repetition logic repeats while the value of the variable propertyVar is less than the literal value "4". If propertyVar is greater than or equal to "4", the loop is never run.

Repeat while propertyVar < 4
  __Do Step 10
  __To Step 14
End Repeat

Or, you can specify the condition at the end of the loop. If propertyVar is greater than or equal to "4", the loop is run once:

Repeat
  __Do Step 10
  __To Step 14 
End Repeat while propertyVar < 4       

You can create repetition logic using either the Test Logic Designer wizard or the Logic Toolbox.