If Statement Step in Step Configuration Wizard

An If step evaluates a condition and executes the following step(s) if the condition evaluates to `true'.

To add an If control step:

  1. While in the Script Steps pane, add a step by choosing the Actions > Add step... command.
  2. Select an If step type, click the button to validate the selection, and specify the following parameters:
    • Run Type: An If step can only be executed sequentially (Sequential).
    • Delay: A delay specifying by how much step start is delayed. A delay value is automatically set when the step is added using the Capture functionality.
    • Timeout: A period of time after which the step execution is considered to have timed out.
    • Ignore step: When this option is selected, the step is skipped at execution time. Selecting this option is equivalent to right-clicking a step in the Script Steps table and choosing the Exclude command from the context menu that appears.
    • Description: An optional step description can be associated with a step.
    • Click Next.

  3. In the Expression Builder specify a condition expression by double-clicking in turn the desired Tcl commands and operators, and TestComposer variables. For detailed information on using the Expression Builder and creating Tcl expressions refer to Using the Composer Expression Builder.
  4. Click Next.

  5. Verify the step summary information and revert to a previous configuration step if needed. Click Finish.

The If statement is added to the steps list. For compound control statements, such as the If instruction, the closing pair EndIf statement is also added.

Example:

  If $result == "pass"
     TclEval puts "operation successful"
 EndIf