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

Have FT Design identify the objects in your application. 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:

  1. (Optional) Make sure you have successfully launched your application and navigated to the page on which the objects you want to test.

  2. On the top of the Editor, click the Inspect application button.

  3. Click Live applications in the AI Inspect pane.

  4. 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.

  5. From the list of open browser tabs in the dialog, select the application you want to inspect, and click Inspect.

    Note: If you haven't added the 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.

  6. Click on your application to start inspecting.

    The Live applications tab starts inspecting the current page and highlighting all identified visual elements by default.

  7. Decide whether you want to view the identified visual elements or text objects, and select the appropriate check boxes.

  8. Follow steps in Add AI steps to your script to create steps for the current web page.

    Tip: To have another inspection on the current page, click the Re-inspect button , or click the Delayed re-inspect button to set the delay for an automatic reinspection.

  9. To create steps for the next page in your application, navigate to the page and click the Re-inspect button .

  10. To inspect a new application, click Select a different application .

Back to top

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:

  1. Make sure you are in the Live applications tab and that you have inspected your application.

  2. Click a highlighted object.

    A tooltip with the suggested step and object description opens.

    Note: Currently, only text in English can be identified in the AI Inspect pane.

  3. Modify the step action and edit the value field.

  4. Perform one of the following:

    • Click Add step to add the step to your script.

    • Click Edit to modify additional step details including Text, Position, and Action in the right pane.

      When editing step details in the right pane, you can click Add step to add the step to your script and then click Run on application to run the step.

    • 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: For an object with more than one identified text option, the text option you selected is verified.

    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 create and edit steps.

  5. After you finish adding all necessary steps, 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 ('.').

  6. Click the button 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 button to go to the Design homepage.

  7. Associate your script with a Codeless Test or a Codeless Unit. See Associate your script.

Back to top

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:

  1. Make sure your application is open.

    Note: Property-based identification cannot be used on applications opened before the Design Agent was started.

  2. Click the down arrow next to Inspect application and select Property based Identification.

    The mouse pointer is converted into a pointing hand.

  3. 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.

  4. Accept the default value or edit it, as required.
  5. 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.

  6. If necessary, modify the step. Click the left arrow icon on the right sidebar to display the step editing panel:

    1. Check the Object hierarchy. To modify the captured value, select an entry from the drop down.

    2. Make the necessary edits, such as Object logical name and Action.
    3. Expand the Properties to view the captured description properties of the object.
    4. 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.

    5. For additional step-editing options, see Manually create and edit steps.

  7. Repeat the above steps to spy on additional objects.
  8. Press Esc to exit property-based identification.

Back to top

Next steps: