Adding Decision Logic Using Decision Test Steps

You can quickly create decision logic by inserting If, Else If, and Else test steps, which provide an alternate method from the Test Logic Designer wizard for creating decision logic. Additionally, you can quickly modify existing decision logic without using the Test Logic Designer wizard.

Else If, and Else test steps allow you to create complex decision logic that can be nested to as many levels as you need.

If <condition=TRUE> Then
  __<Run sequence of test steps> 
Else If <condition=TRUE> Then
  __<Run sequence of test steps>
Else 
  __<Run sequence of test steps>
End If

For example, the condition in the following decision logic compares the variable propertyVar with the literal value "4". If the variable propertyVar is greater than the literal value "4", then steps 5 through 9 are run. If it is less than "4", then steps 10 through 14 are run. If it is equal to "4", then step 15 is run:

If propertyVar > 4 Then 
  __Run Step 5 to Step 9
Else If propertyVar < 4 Then 
  __Run Step 10 to Step 14   
Else 
Run Step 15 
End If

To quickly insert decision test steps into a visual test:

  1. Open the visual test and select the test steps that you want to include in the decision logic. To select a sequence of test steps, select the first step, press and hold the Shift key, and then select the last test step in the sequence. Any test steps between the first and last test step are automatically selected.
  2. Click Insert an If Type Logic Item on the toolbar. The selected test steps are bracketed by an If test step and an End If test step.
  3. Optional: To insert an Else If or Else test step in the If...End If logic, select the test step that you want the Else If or Else test step to appear after, and click either Insert an Else If Type Logic Item or Insert an Else Type Logic Item.