Add conditional steps
Conditions such as If and If/Else increase the control over test runs, making your script more resilient and robust. You can include conditions in your script, and check an object's existence, or, for some object types, the object's state or value. You can also check the value of a parameter.
To add conditional steps:
-
Add a condition in one of the following ways:
- Type If in an empty step and press Enter to form an If condition block. To form an If/Else condition block, type Else in another empty step.
- Hover over an empty step line, click the Add step button
, and select Conditions > If / If-Else.
-
Specify the AI Object or parameter to check:
-
Click the Parameter or AI Object button to specify which to check.
Note: When you switch between the AI Object and Parameter options, the step is reset to a template. To undo, use CTRL+Z.
-
To check a parameter, select an existing parameter from the list or click + New parameter to create one.
To check an object, select the Object class and specify an object description, as described in Specify object identification details.
-
-
Edit the If step's condition.
-
You can check an object's existence, or, for some object types, the object's state or value.
-
You can also check the value of a parameter.
-
When checking the value of an object or parameter, you can check whether the value is empty or not, and whether it is or isn't equal, containing, or within a specified string. The string you specify can be a parameter or a constant.
You can type the step in the editor or compose it in the step editing pane. For syntax details, see If/Else statements.
-
-
Edit steps in an If or If/Else condition block. For details, see Manually add and edit steps.
See also: