Manually edit steps
This topic describes how to manually create and fine tune steps in your script.
Manually add and edit steps
You can create and edit steps manually by typing them in the editor or using the button and selecting ready-made step templates.
Tip: You can undo or redo any changes you make to the script's steps in the Editor or the step editing pane using the Undo and Redo buttons. In the Editor, you can also use CTRL+Z / CTRL+Y.
To add a new step to your script, do one of the following:
-
Place the cursor at the beginning or end of a step and press Enter to add a new line before the step. Press Enter anywhere else in the step to add a new line after the step.
In the new line, you can type a step or click the Add step button to select a step template.
-
Click the Add step button and select the type of step you want to add. For example, you can select Click, Type, Verify, Wait, or Navigate steps.
You can also select steps that set output parameter values or add Condition blocks, in which you can add steps that will run only under certain conditions.
Modify the step template that is added with the details of your object and relevant values.
Note: The Add step button is displayed when you hover over a new empty step or below the last step in the script.
To edit steps in your script:
You can type directly into the step box, using the syntax rules described in Step syntax.
To further edit the step, click the double-arrow icon in the sidebar to open the step editing pane. Changes you make in this pane affect the selected step in the script.
In this pane, you can fine-tune object identification details, select an action for the step, and modify additional step properties.
-
Specify object identification details:
-
Type a class in the Object class drop down. Type the first letter to view a list of the available classes.
-
(Optional) Enter text to use to identify the object. For example, the name of a button or a text box. Enter a text string or use an input parameter. For details on using parameters, see Pass a value to a step.
-
For steps on Text objects, you can select Partial Text. This indicates the specified text should be identified even if it is only part of a larger text block.
Example:
Suppose your application has the following text: Learn more about using this site. The words learn more link to another location.
AI Object Detection identifies this whole sentence as one text block, but you want to click the Learn more words.
In this case, you enter Learn more as the text to identify, and select the Partial Text option.
If you select the Partial Text option, a PT (Partial Text) indicator is added to the step.
-
If multiple similar objects are displayed in the application, click Add position or relation to specify a specific instance.
Select whether to add a position or a relation:
-
A position describes the object's ordinal location, and the direction in which to count.
If you specify a position, a P (Position) indicator is added to the step.
-
A relation let's you uniquely describe your object by its proximity to another object in the application.
Currently, you can add relations only during inspection, and only when inspecting a live application. For details, see Add a relation to an object's description.
To add a position to a step that already has a relation defined, remove the relation by clicking the Delete button .
-
The object description you create is tested against the object in the application. If the description does not uniquely describe an object in the application, you cannot run the step or add it to your script.
-
-
Select an action for the step.
-
Specify additional step properties:
-
For a Verify step, specify the condition the step checks, as well as other step configuration options. For details, see Add verification steps.
-
(Optional) Configure scroll settings and OCR languages for this step. For details, see Customize step settings.
-
-
(Optional) Select Exclude step from the test run, to temporarily omit the step from the script run.
To re-include a step in the run, clear the Exclude step from the test run option.
Similarly, you can exclude or re-include a condition block in the test run by selecting the If or Else step and using the exclude options available.
Synchronize your script
You can synchronize your scripts, making sure steps are performed only when your application is ready for them.
You can add generic Wait steps, that simply wait for a specified number of second to pass, or more specific Verify steps, that check for the existence of a specific object.
We recommend using Verify steps that wait for a relevant object, rather than more arbitrary Wait steps.
Add a Wait step
Syntax: Wait <number> seconds
A Wait step instructs the script to pause the run for a specified number of seconds. This allows time for the application to be ready for the next step.
Example:
Wait 6 seconds
Click the hamburger_menu
Click the profile
Type 'aidemo1' into 'USER NAME' input
Type 'Aidemo1' into 'PASSWORD' input
Click the 'LOGIN' button
Syntax: Verify <object> exists
A Verify step checks whether an object exists in the application. This ensures the object is present before the script performs any operation on it, increasing the test run success rate.
Define a timeout for the Verify step, to specify how long to wait for the object.
For details on adding and editing a Verify step, see Add verification steps.
Example:
Verify the hamburger_menu exists
Click the hamburger_menu
Click the profile
Type 'aidemo1' into 'USER NAME' input
Type 'Aidemo1' into 'PASSWORD' input
Click the 'LOGIN' button
Manage your script steps
The script editor supports standard editing functionality. You can edit, copy, paste, move, delete, and duplicate text, steps, and blocks by typing, using keyboard shortcuts, and right-click menus.
If you select multiple steps, you can use the right-click menu to Duplicate, Delete, or temporarily Exclude these steps from the run.
The steps in your script must follow the rules described in Step syntax. The editor indicates any syntax errors or erroneous steps.
This section provides some additional information about how to move, duplicate, copy and paste steps and how to manage condition blocks.
To... | Do... |
---|---|
Copy and paste a step or step text |
Select the step or the step's text and use CTRL+C / CTRL+V to copy and paste it to an empty row.
|
Move a step or condition block |
Hover over the vertical drag bar in the step's margin, and drag the step or block to the target location in the script. To drag a block, use the vertical drag bar in the margin of the If step.
While dragging, a line or frame is displayed, indicating where the step or block will be placed if you drop it. |
Duplicate a step or block |
Do one of the following:
|
Duplicate steps from different condition blocks |
If you duplicate multiple steps inside different condition blocks, all selected steps are copied to rows outside of the blocks in their original order. |
Exit a condition block |
Select the last step of the condition block and press Enter twice to exit it. |
Add a relation to an object's description
A relation let's you uniquely describe your object by its proximity to another object in the application. For more details, see Uniquely identify objects by location.
Currently, you can add relations only during inspection, and only when inspecting a live application.
To add a relation to an object's description:
-
Inspect your application and click one of the highlighted objects.
For details, see Inspect your application for objects.
-
A pop-up dialog box with the suggested step and object description opens.
Click Edit to open the step editing pane.
If there are additional identical objects on the application, a Position is added by default.
-
Click the Delete button to remove the position.
-
Click Add position or relation, and select Add relation.
The application is displayed showing the following highlights:
-
The step's object is highlighted with a blinking dot. This is the object you are describing.
-
Objects suggested as candidates for a related object are highlighted with squares.
Tip: Select the Visual Elements and Texts options as needed, to display all relevant objects.
-
-
Select one of the highlighted objects to be the Related object.
-
Accept or modify the selected direction, specifying the location of the related object in relation to the step's object:
The related object Is above / Is on the right / Is below / Is on the left of the related object.
-
Accept or modify the description of the related object:
-
To change the related object's identifying text, click the text.
Next, click the customization button , and select whether to edit the text or use a parameter. For details on using parameters, see To pass a value to a step during inspection.
-
The description includes a Position by default if additional identical objects are found. You can remove, modify, or add a position as needed.
The object description you create is tested against the object in the application. If the description does not uniquely describe an object in the application, you cannot run the step or add it to your script.
-
-
Complete the step definition, as described in Add AI steps to your script and add the step to the script.
A Relation indicator is added to the step.
See also: