Create a script based on your 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
After launching your application, FT Design can identify the objects in the application visually, similarly to the way a person would. You can then add steps to your script that perform operations on these objects.
For the types of objects that can be identified, see the AI-based testing section of the UFT One Help Center.
To inspect your application for objects:
Make sure you have successfully launched your application and navigated to the page whose objects you want to test.
Tip: If you haven't, you can launch it in the AI Inspect pane. Skip this step if you already opened your application without configuring it.
Click the Inspect application button. The AI Inspect pane opens.
Click Live applications.
The Live applications tab opens. The tab has the following sections:
Select a live application to inspect
Select a web application to inspect.
Shows the applications that you recently inspected.
Lists all of the applications that you added on the Script applications pane.
Navigate between added applications with a left or right arrow.
To launch an application, click the ellipsis button on its card and select Launch .
Click Manage applications to go to the Script applications pane.
Click Web application.
A dialog box opens, showing all the browser tabs that are currently open.
Select a browser tab. On the right, you can preview the name of the selected application.
Click Inspect. The AI Inspect pane redirects you to the application page. Click on the page to start inspecting.
Click + Add to 'Script applications' to add this application to the Script applications pane, if you haven't added it before.
If you cannot find the application that you want to test, select a browser type on the bottom, enter an application URL, and click the arrow icon.
The Live applications tab displays the current web page and begins inspecting it. When the inspection is complete, all identified objects are highlighted.
- Select the Visual Elements and/or Texts check boxes to show the visual or text objects on your web page.
- Follow steps in Add AI steps to create steps for your script.
Tip: As you navigate within the browser, to inspect the current page, click the Re-inspect button , or click the Delayed re-inspect button to set the delay for an automatic reinspection.
When you finish creating steps for one page in your application, to continue to another one, navigate to the desired page and click the Re-inspect button .
- To inspect a new application, click Select a different application . To continue inspecting the current application, click Back to go back to the inspection result tab of the current application.
Add AI steps
After you have the objects in your application highlighted, you can add AI steps to your script with a single click.
To add AI steps:
Make sure you are in the Live applications tab and that you have inspected your application.
The Live applications tab shows the web page currently displayed in the web browser.
Click a highlighted object.
A tooltip with the suggested step and object description opens.
Modify the step action, edit the value field, and click Add to script.
Alternatively, click Edit step to modify additional step details including Text, Position, and Action on the Edit step section.
Note: For an object with more than one identified text option, the text option you selected is verified.
After you add a step to your script, the Edit step section shows the step count and success message.
Steps created with AI Inspection are marked with an AI indicator, as shown below:
To edit or fine-tune these steps in the Editor, see Manually create and edit steps.
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.
Click Save to save your script.
For a new script, you are prompted to enter a name.
The script name must not include the dot character ('.').
Click the icon in the upper-left corner to display the left-hand pane and view the script you just saved.
In the left-hand pane, you can:
Click + to add a new script.
You are prompted to keep the applications you configured for this new script.
Search for a specific script.
View all script files created in the workspace.
Click the icon to go to the Design homepage.
Associate your script with a Codeless Test entity. See Associate your script.
Add property-based steps
You can also 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:
Make sure your application is open.
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 page and click an object that the AI engine 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.
Since this step was created with property-based detection, it is marked with a PB (Property Based) icon.
If necessary, modify the step. Click the left arrow icon on the right sidebar to display the step editing panel:
Check the Object hierarchy. To modify the captured value, select an entry from the drop down or click the Highlight object button to locate the selected object in the application.
Note: The Highlight object button works only on applications launched from FT Design. Make sure your application is visible before you click the button.
- 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 red symbol is displayed in the step, the incorrect syntax is underlined, and an error message is displayed in the step editing panel.
For additional step-editing options, see Manually create and edit steps.
- Repeat the above steps to spy on additional objects.
- Press Esc to exit property-based identification.