Step syntax
Write your steps in plain English, using the syntaxes described below (the words the and that are optional).
You can use single quotes or double quotes to enclose a string. The string can also contain quotes, but these quotes must be a different type than the quotes enclosing the string.
Supported actions
The following actions are supported:
Identify a control by text
The following control types can be described more specifically by a name, a text string:
button, checkbox, combo box, input, radio button, text box, toggle.
To add a control's name in the step, add the identification text, in quotes, before the control type.
For example:
Syntax: Click/press/tap the "<text for identification>" <control type>/text
Example: Click the "SIGN IN" button
Note: Text related to a class may be marked together in the user interface. This example is displayed as . Press the Backspace key twice to delete the text and class together.
Syntax details
The table below describes the syntax for each action.
For simplicity, most of the syntaxes include '<text for identification>', because it is commonly used. However, this text is optional, as described in Identify a control by text.
Verification steps
You can create different types of verification steps, checking a control's existence, status, or value.
Verify that a control exists or does not exist
Syntax:
-
Verify that the '<text for identification>' <control type> exists
-
Verify that the '<text for identification>' <control type> does not exist
Example:
-
Verify that the alarm exists
-
Verify the 'INPUT' button does not exist
Verify the state of a control
Syntax:
-
Verify that the '<text for identification>' toggle is on
-
Verify that the "<text for identification>" toggle is off
-
Verify that the "<text for identification>" radio_button is selected
-
Verify that the '<text for identification>' radio_button is not selected
-
Verify that the '<text for identification>' checkbox is checked
-
Verify that the "<text for identification>" checkbox is not checked
Example:
-
Verify that the 'AM' radio_button is selected
-
Verify the 'light switch' toggle_button is on
Verify the value of a control
You can verify 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 an input parameter or a constant.
Syntax:
-
Equal:
Verify that the value of '<text for identification>' <control type> is <value>
-
Not equal:
Verify that the value of '<text for identification>' <control type> is not <value>
-
Contains:
Verify that the value of '<text for identification>' <control type> contains <value>
-
Not contain:
Verify that the value of '<text for identification>' <control type> does not contain <value>
-
Within:
Verify that the value of "<text for identification>" <control type> is within <value>
(The
is
is optional) -
Not within:
Verify that the value of "<text for identification>" <control type> is not within <value>
(The
is
is optional) -
Empty:
Verify that the value of "<text for identification>" <control type> is empty
(The
is
is optional) -
Not Empty:
Verify that the value of "<text for identification>" <control type> is not empty
Example:
-
Verify that the value of "Username" input is "John"
-
Verify that the value of "Username" input is not "John"
-
Verify that the value of "Username" input contains "John"
-
Verify that the value of "John" Text within "Good Morning John"
-
Verify that the value of "Password" input is empty
If/Else statements
Use an If step if you want script steps to run conditionally. Else statements are optional.
You can create condition steps that check a control's existence or status.
Check a control's existence:
Syntax:
If the <control type> exists <steps> Else <steps>
If the '<text for identification>' <control type> does not exist <steps> Else <steps>
Example:
If the menu exists
Click the menu
Else
Click the 'Close' button
If the menu does not exist
Click the 'Close' button
Else
Click the menu
Check a control's state:
Checking a control's state is supported only for radio_button, checkbox, and toggle.
Syntax:
-
radio_button
If the '<text for identification>' radio_button is selected <steps> Else <steps>
If the '<text for identification>' radio_button is not selected <steps>
-
check_box
If the '<text for identification>' checkbox is checked <steps> Else <steps>
If the '<text for identification>' checkbox is not checked <steps>
-
toggle
If the '<text for identification>' toggle is on <steps> Else <steps>
If the '<text for identification>' toggle is off <steps>
Example:
-
If the "All day" toggle is off
Enter "8:00" into the "start hour" input
Enter "11:00" into the "end hour" input
Click the 'Save' button -
If the 'Use proxy' check_box is checked
Enter "12.34.56.78" in the 'Proxy server' input
Else
Click the 'Save' button -
If the 'AM' radio_button is selected
Select the 'PM' radio_button
Else
Click the 'Save' button
See also: