Step syntax

Write your steps in plain English, using the syntaxes described below (the word the is optional). You can type steps in the editor or compose them in the step editing pane.

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 steps

The following steps are supported: 

Back to top

Identify an object by text

The following object types can be described more specifically by a name, a text string:

button, checkbox, combo box, input, radio button, text box, toggle.

To add an object's name in the step, add the identification text before the object type.

The identification text can be a parameter, a constant (in quotes), or a rule. Use rules and regular expressions to describe text whose value in the application is not always the same. For details, see Use rules and regular expressions.

To use a parameter, type @ and then type the parameter's name, select an existing parameter from the list, or click + New parameter to create one.

Tip: In the script editor steps, a class and its identification text may be highlighted together. For example, a step with the object and its text highlighted as one. Press the Backspace key twice to delete the text and class together.

Syntax

The syntax is described with the Click action, but other actions are supported in the same way.

Identification text type Syntax
Constant Click/press/tap the "<text for identification>" <object type>/text
Rule, non text object
  • Click/press/tap the <object type> whose name contains "<rule text>"

  • Click/press/tap the <object type> whose name does not contain "<rule text>"

  • Click/press/tap the <object type> whose name begins with "<rule text>"

  • Click/press/tap the <object type> whose name ends with "<rule text>"

  • Verify that the <object type> whose name <rule> "<rule text>" <verification condition>

Rule, text object
  • Click/press/tap the text that contains "<rule text>"

  • Click/press/tap the text that does not contain "<rule text>"

  • Click/press/tap the text that begins with "<rule text>"

  • Click/press/tap the text that ends with "<rule text>"

  • Verify that the text that <rule> "<rule text>" <verification condition>

Regular expression, non text object 

  • Click the <object type> whose name matches "<regular expression pattern>"

  • Verify the <object type> whose name matches "<regular expression pattern>" <verification condition>

Regular expression, non text object 

  • Click the text that matches "<regular expression pattern>"

  • Verify the text that matches "<regular expression pattern>" <verification condition>

Tip:  

  • Only use regular expressions if the predefined rules are not sufficient.

  • Use Python regular expression syntax.

  • If the identification text is longer than your regular expression pattern, use wildcards to represent any characters in the text that might come before or after your pattern.

Examples 

  • Click the "SIGN IN" button

  • Click the Button whose name ends with "Total"
  • Click the Button whose name matches "\w+\s\d+\,\s\d+"

  • Verify that the value of the input whose name contains "Total" contains "$49.99"

  • Click the Text that contains "Total"

  • Verify that the text that contains "Total" contains "$49.99"

  • Enter "joe@OT.com" into the input whose name begins with "user name"

Back to top

Syntax details

The table below describes the syntax for each step.

For simplicity, most of the syntaxes for operations on objects include '<text for identification>', because it is commonly used. However, this text is optional, as described in Identify an object by text.

Step Description
Call function

Call a custom JavaScript function. For details, see Call a custom function.

Syntax: Call <function name> with <argument1 name>=<argument1 value>, <argument2 name>=<argument2 value>

The number of argument name and value pairs must match the function signature.

Examples:

  • Call Sum with argument1=5, argument2=@second-string

  • Call FindRoot with argument=Default 5

    (When you type Default, the defined default value is automatically displayed in the step).

Check

Select a checkbox:

Syntax: Check the '<text for identification>' check_box

Example: Check the checkbox

Click / Press / Tap

Perform a Click / Press / Tap operation on the object.

Syntax: Click/press/tap the <object type>

Example: Click the bell

Enter

Replace the value in an input object with the specified string:

Syntax: Enter "<text to enter>" into the '<text for identification>' input/field

Note: You can also replace the word into with in or inside.

Example: Enter "MyName" into "USER NAME" input

Go back

Go back to the previous page.

Syntax: Go back

Hover

Hold the pointer over the object for 2 seconds.

Syntax: Hover over the '<text for identification>' <object type>

Note: You can also omit the word over or replace it with on.

Example: Hover over the shopping_cart

Navigate

In the browser, go to a specified website.

Syntax: Navigate to <URL>

Example: Navigate to https://www.google.com/

Search

Search for the specified text.

Syntax: Search for "<text to find>"

Example: Search for "Wikipedia"

Select

Select a radio button:

Syntax: Select the '<text for identification>' radio_button

Example: Select the 'web-based' radio_button

Set

Use the Set action to assign different types of values to output parameters.

Assign a constant value to an output parameter.

Syntax: Set "value" into @<output parameter name>

Example: Set 1 into @Outpara1

 

Assign the value of an input parameter to an output parameter.

Syntax: Set @<input parameter name> into @<output parameter name>

Example: Set @Inputpara1 into @Outputpara1

 

Assign the value of an AI object to an output parameter.

Syntax:

  • Set value of '<text for identification>' <object type> into @<output parameter name>

  • Set "<text for identification>" <object type> value into @<output parameter name>

Examples:

  • Set value of 'Username' input into @Outpara1

  • Set "Username" input value into @Outpara1

Toggle

Turn a switch On or Off.

Syntax: Toggle <State> the toggle_button

Example: Toggle On the toggle_button

Type

Type the specified string into a text object, after clicking approximately in the center of the object.

Syntax: Type "<text to type>" into the "<text for identification>" input/field

Note: You can also replace the word into with in or inside.

Example: Type "The boy's shirt" into "ITEM" input

Uncheck

 

Clear a checkbox:

Syntax: Uncheck the '<text for identification>' check_box

Example: Uncheck the 'web-based' checkbox

Wait

Instruct a script to wait for a few seconds.

Syntax: Wait <number> seconds

Example: Wait 6 seconds

Back to top

Verification steps

You can create different types of verification steps, checking an object's existence, status, or value, or checking the value of a parameter. For details, see Add verification steps.

Tip: In the verification step syntax, the word that within Verify that is optional.

Verify that an object exists or does not exist

Syntax

Condition Syntax
Exists

Verify that the '<text for identification>' <object type> exists

Does not exist Verify that the '<text for identification>' <object type> does not exist

Examples:

  • Verify that the alarm exists

  • Verify the 'INPUT' button does not exist

Verify the state of a object

Syntax

Condition Syntax
On (Toggle)

Verify that the '<text for identification>' toggle is on

Off (Toggle) Verify that the "<text for identification>" toggle is off
Selected (Radio button) Verify that the "<text for identification>" radio_button is selected
Not selected (Radio button) Verify that the '<text for identification>' radio_button is not selected
Checked (Check box) Verify that the '<text for identification>' checkbox is checked
Not checked (Check box)

Verify that the "<text for identification>" checkbox is not checked

Examples

  • Verify that the 'AM' radio_button is selected

  • Verify the 'light switch' toggle_button is on

Verify the value of an object

  • 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 a parameter or a constant.

  • If you have an Aviator license, you can use a Smart Verify step, in which you can describe, in plain English, anything you want to check about the value.

  • To use a parameter in the condition (for Verify or Smart Verify), type @ and then type the parameter's name, select an existing parameter from the list, or click + New parameter to create one.

Syntax

Condition Syntax
Smart Verify

 Smart Verify that the value of "<text for identification>" <object type> is <free-text condition>

Equal Verify that the value of '<text for identification>' <object type> is "<value>"
Not equal Verify that the value of '<text for identification>' <object type> is not '<value>'
Contains

Verify that the value of '<text for identification>' <object type> contains "<value>"

Not contain

 Verify that the value of '<text for identification>' <object type> does not contain "<value>"

Within 

Verify that the value of "<text for identification>" <object type> is within '<value>'

(The is is optional)

Not within

 Verify that the value of "<text for identification>" <object type> is not within '<value>'

(The is is optional)

Empty

Verify that the value of "<text for identification>" <object type> is empty

(The is is optional)

Not Empty 

Verify that the value of "<text for identification>" <object type> is not empty

Examples

  • Smart Verify the value of "Email" input is a valid email address and is part of the opentext domain

  • Smart Verify that the value of "Date" input is earlier than 2030 and follows the DD/MM/YYYY format

  • 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

Verify the value of a parameter

  • 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 a parameter or a constant.

  • To use a parameter in the condition, type @ and then type the parameter's name, select an existing parameter from the list, or click + New parameter to create one.

Syntax

Condition Syntax
Smart Verify

Smart Verify that the value of @<parameter name> is <free-text condition>

Equal Verify that the value of @<parameter name> is "<value>"
Not equal Verify that the value of @<parameter name> is not '<value>'
Contains

Verify that the value of @<parameter name> contains "<value>"

Not contain

 Verify that the value of @<parameter name> does not contain "<value>"

Within 

Verify that the value of @<parameter name> is within '<value>'

(The is is optional)

Not within

 Verify that the value of @<parameter name> is not within '<value>'

(The is is optional)

Empty

Verify that the value of @<parameter name> is empty

(The is is optional)

Not Empty 

Verify that the value of @<parameter name> is not empty

Examples

  • Smart Verify the value of @email is a valid email address and is part of the opentext domain

  • Verify that the value of @username is "John"

  • Verify that the value of @username is not "John"

  • Verify that the value of @username contains "John"

  • Verify that the value of @username within "Good Morning John"

  • Verify that the value of @password is empty

Back to top

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 an object's existence or status, or steps that check the value of an object or parameter. For details, see Add conditional steps.

Check an object's existence:

Syntax

Condition Syntax
Exists

If the <object type> exists

    <steps>

Else

     <steps>

Does not exist

If the '<text for identification>' <object type> does not exist

    <steps>

Else

    <steps>

Examples: 

  • 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 an object's state:

Checking an object's state is supported only for radio_button, checkbox, and toggle.

Syntax

Condition Syntax
On (Toggle) If the '<text for identification>' toggle is on
   <steps>
Else
   <steps>
Off (Toggle) If the '<text for identification>' toggle is off
   <steps>
Selected (Radio button)

If the '<text for identification>' radio_button is selected

   <steps>

Else

   <steps>

Not selected (Radio button)

If the '<text for identification>' radio_button is not selected

   <steps>

Checked (Check box)

If the '<text for identification>' checkbox is checked

    <steps>

Else

    <steps>

Not checked (Check box)

If the '<text for identification>' checkbox is not checked

   <steps>

Examples 

  • 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

Check an object or parameter's value:

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.

To use a parameter in the condition, type @ and then type the parameter's name, select an existing parameter from the list, or click + New parameter to create one.

Syntax

The syntax shown below is for checking the value of an object. To check the value of a parameter, replace the '<text for identification>' <object type> with @<parameter name>.

Condition Syntax
Equal If the value of '<text for identification>' <object type> is '<value>'
  <steps>  
Not equal If the value of '<text for identification>' <object type> is not "<value>"
   <steps>  
Else
    <steps>
Contains

If the value of '<text for identification>' <object type> contains '<value>'
   <steps>  

Not contain

 If the value of '<text for identification>' <object type> does not contain "<value>"
   <steps>  
Else
    <steps>

Within 

If the value of "<text for identification>" <object type> is within '<value>'
   <steps>  
Else
    <steps>

(The is is optional)

Not within

 If the value of "<text for identification>" <object type> is not within "<value>"
   <steps>  

(The is is optional)

Empty

If the value of "<text for identification>" <object type> is empty

   <steps>  

Else

    <steps>

(The is is optional)

Not Empty 

If the value of "<text for identification>" <object type> is not empty

   <steps>  

Else

    <steps>

Examples 

  • If the value of "Open Hours" text_box is "AM"
           Enter "8:00" into the "start hour" input
           Enter "11:00" into the "end hour" input
    Click the 'Save' button

  • If the value of "Username" input is empty
          Enter "MyName" in the 'Username' input
          Enter "MyPassword" in the 'Password' input
    Else
          Enter "MyPassword" in the 'Password' input
    Click the 'Save' button

  • If the value of the Text contains 'MyCompany'
          Click the 'Add to cart' button

  • If the value of @CompanyName contains 'MyCompany'
          Click the 'Add to cart' button

Back to top

See also: