Add SelectLaptop steps using AI Inspection

This exercise describes how to add steps to the SelectLaptop action by using AI Inspection.

Add steps to add the HP Chromebook 14 G1 laptop to your cart

This procedure describes how to add steps to browse to the Advantage Online Shopping LAPTOPS page and add an HP Chromebook 14 G1 laptop to the shopping cart.

Do the following:

  1. Make sure that you have logged in to the Advantage Online Shopping site in your browser and the homepage is open.

  2. In UFT One, open the SelectLaptop action, either from the Solution Explorer, or the canvas.

  3. Click the AI Identification toolbar button.

    UFT One is hidden and the AI Inspection window is displayed.

  4. Click on the open page.

    The AI Inspection window starts importing the web page and highlighting all visual elements on the page.

  5. Select Texts on the window toolbar to also highlight the text objects on the page.

    Note: An AIUtil.SetContext step has already been added in the Login action. You do not need to add another one.

  6. Click the highlighted Laptops text to display the tooltip.

  7. Click Add to test to add the corresponding step to the Editor.

    Additionally, you can click Edit step and then edit object identification information on the right-hand of the window.

  8. To switch between the AI Inspection window and your application, click the down arrow near Context and select Go to inspected application.

  9. Click LAPTOPS on the page to browse to the LAPTOPS page.

  10. Then open the AI Inspection window and click Re-inspect to inspect the LAPTOPS page.

  11. Click the HP Chromebook 14 text. In the tooltip that opens, click Add to test to add the corresponding step to the Editor.

  12. Repeat the above steps to navigate to the HP Chromebook 14 details page, have the AI Inspection window re-inspect the page, and add the step that clicks the Add to Cart button to the Editor.

Back to top

Send feedback directly from UFT One

In the AI Inspection window, click How is the detection? Help us to improve to open the Feedback Tool and send Micro Focus feedback about the object detection.

Back to top

You steps in the Editor View

When you're done adding steps to the SelectLaptop action, your Editor should look like this:

AIUtil.FindTextBlock("LAPTOPS").Click
AIUtil.FindTextBlock("HP Chromebook 14", micFromLeft, 1).Click
AIUtil("button", "ADD TO CART").Click

Back to top

Next steps: