Insert conditional statements

You can insert conditional statements to verify the values of the variables in the script and perform actions in the application.

Before you begin

All variables to be tested while running conditional statements must be captured during the script recording. To do this, use the Get a Specific Property Value feature that is available in the verification point wizard while recording the script to assign a control property to a variable in the script.

To insert conditional statements:


  1. Select the test line in the script editor.

  2. Right-click and select Insert Condition (If Clause) (). An If Then clause is inserted in the script editor. The selected test line is inserted in the Then group.

  3. Select the If clause.

  4. In the Properties-General view, specify the variable values that must be verified.

    1. Select the variable that must be verified in the Left Side field. The Left Side field lists all the variables that are declared during the script recording before the selected test line.

    2. Select the required parameter in the Compares To field.

    3. Type the variable value in the Right Side field. For string values, specify the value using quotation marks, for example, "Visa". You can also select another variable from the list if the first operand must be verified against another variable.

  5. Optional: To run other test lines that must also run if the variable conditions are met, select and drag the test lines into the Then group.

  6. You can insert the Else clause for the test lines that must be run if the variable conditions are not met. Select the If or Then clause, or any test lines in the Then group, right-click and select Insert Else Clause (). Select and drag the test lines that must be executed if the variable conditions are not met into the Else group.

  7. Click File > Save to save the script. During script playback, the variable conditions are checked and the required test lines are run.

Related tasks

Get a property value

Related reference

Properties view - General page


Search Tips   |   Advanced Search