Create steps based on application
This topic describes how to use AI Inspection to identify objects in your application and create steps in your script.
Note: This task is a part of a higher-level task. For details, see Create a script.
Inspect your application for objects
Identify the objects in your application using AI Object Inspection. Then add steps to your script that perform operations on these objects.
For the types of objects that can be identified, see Supported controls.
To inspect your application for objects:
-
(Optional) Make sure you have successfully launched your application and opened the page with the objects you want to test.
-
Above the Editor, click the Inspect application button.
-
Click Live applications in the AI Inspect pane.
-
Click Web application on the Live applications tab.
If you haven't launched your application, in the Script applications section, click the ellipsis button on the application card and select Launch and Inspect. To go to the Script applications pane, click Manage applications.
-
From the list of open browser tabs in the dialog, select the application you want to inspect, and click Inspect.
To add a selected application to the Script applications pane, click + Add to 'Script applications' in the dialog.
If the application you want to test is not available in the dialog, select a browser type, enter the application URL, and click the arrow icon to open the application.
-
Click on your application to start inspecting.
The Live applications tab starts inspecting the current page and highlighting all identified visual elements by default.
-
Decide whether you want to view the identified visual elements, text objects, or both, and select the appropriate checkboxes.
Note: To identify text in languages other than English, customize your script settings. See Customize script settings.
-
Follow steps in Add AI steps to your script to create steps for the current web page.
Tip: To inspect the current page again, click the Re-inspect button , or click the Delayed re-inspect button to set the delay for an automatic reinspection.
-
To create steps for the next page in your application, go to that page and click the Re-inspect button .
- To inspect a new application, click Select a different application .
Add AI steps to your script
After you have the objects in your application highlighted, you can add AI steps to your script.
To add AI steps to your script:
-
Make sure you are in the Live applications tab and that you have inspected your application.
-
Click a highlighted object.
A pop-up dialog box with the suggested step and object description opens.
-
Accept or modify the object description.
To make the description more accurate, click Edit to open the Edit step pane.
You can modify the Identification text, or add a Position or Relation.
Sometimes, multiple text strings are identified near the object. You can select the one to use for object identification from a drop-down list within the Identification text box.
To edit the Identification text, click the customization button and select Edit. Press Enter or click out of the text box to save your edits. To restore the original text suggested by the inspection, click the restore button .
For details on using a Position or Relation to uniquely describe an object, see Manually edit steps.
-
Accept or modify the step action and edit the value field or other step options.
For more details on the Verify step action, see Add verification steps.
-
You can use a parameter for the object's Identification text or for the step's input Value. For details, see Pass a value to a step
-
Add the new step to your script.
In the step's pop-up dialog box or in the Edit step pane, do one of the following:
-
Click Add step to add the step to your script.
-
Click Add and run to add the step to your script and run it. This verifies that your step is correct and advances the application to the next state, re-inspecting the application for the next step.
Click the down-arrow and set a delay to provide time for the application to load after running the step, before re-inspecting the application.
Note: Avoid adding steps with objects that were incorrectly identified. For example, if a button is identified as a text box, or a check mark is identified as a button, such objects may be identified inconsistently and fail in subsequent runs.
Steps created with AI Inspection are marked with an AI indicator in the Editor, as shown below:
To edit or fine-tune these steps in the Editor, see Manually edit steps.
-
-
Associate your script with a codeless test or a unit. See Associate or unassociate your script.
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.
Add property-based steps to your script
Add property-based steps to your script using the built-in Spy. Use this option if the AI engine was unable to identify an object. Note that if you add property-based steps, you cannot run the script on a different environment.
To add property-based steps to your script:
-
(Optional) Open the application you want to test.
Note: Property-based identification cannot be used on applications opened before the Design Agent was started.
-
Click the down arrow next to Inspect application and select Property based Identification.
The mouse pointer is converted into a pointing hand.
-
Go to your application.
Hold the CTRL key if you need to suspend the Spy while going to your application.
-
Click an object that the AI Object Inspection was unable to identify. A dialog box opens with the step name and the identified object name.
- Accept the default value or edit it, as required.
-
Click Apply. A step is added to the Editor.
The step is marked with a PB (Property Based) icon.
-
If necessary, modify the step. Click the double arrow icon on the sidebar to display the step editing pane:
-
Check the Object hierarchy. To modify the captured value, select an entry from the drop down.
- Make the necessary edits, such as Object logical name and Action.
- Expand the Properties to view the captured description properties of the object.
-
If your step contains syntax errors, a warning symbol is displayed in the step, the incorrect syntax is underlined, and an error message is displayed in the step editing pane.
-
For additional step-editing options, see Manually edit steps.
-
- Repeat the above steps to spy on additional objects.
- Press ESC to exit property-based identification.
Next steps: