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:

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

  2. Above 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.

    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.

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

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

  9. To create steps for the next page in your application, go to that 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 pop-up dialog box with the suggested step and object description opens.

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

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

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

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

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

  8. Save the script.

  9. Associate your script with a codeless test or a unit. See Associate or unassociate 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. (Optional) Open the application you want to test.

    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.

    Hold the CTRL key if you need to suspend the Spy while going to your application.

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

  5. Accept the default value or edit it, as required.
  6. Click Apply. A step is added to the Editor.

    The step is marked with a PB (Property Based) icon.

  7. If necessary, modify the step. Click the double arrow icon on the sidebar to display the step editing pane:

    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 warning symbol is displayed in the step, the incorrect syntax is underlined, and an error message is displayed in the step editing pane.

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

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

Back to top

Next steps: