Record your first action - Login steps

This exercise describes how to use AI Object Record to record test steps that log in to your account on the Advantage Online Shopping site.

Record steps to log in to your account

In this procedure you will learn how to use AI Object Record to record the Login action.

To record AI-based steps to log in to your account:

  1. Open the Advantage Online Shopping site in your browser.

    For best identification results, set your window display settings to display all text and apps at 100% and set the browser zoom level to 100%.

  2. Double-click the Login action to open it, and then click the AI Object Record toolbar button .

    UFT One is hidden so that you could see your browser window, and the AI Object Record toolbar appears.

  3. Click on the browser window, and the AI Object Record toolbar inspects the application to identify its objects.

    After inspection, your application page should display detected controls as shown in the image below. The highlighted controls are the AI objects you can interact with.

  4. Hover over the highlighted Profile object at the top right to view the object description and suggested step.

  5. Click the Profile icon to display the Sign In dialog.

    AI Object Record adds the step that clicks the Profile icon to the Editor and inspects the new page.

     

  6. Click the highlighted Username input box, and enter a username. AI Object Record automatically adds the step that types a username to the Username input box to the Editor.

    You can hover over the input box to see the object's description and suggested step. If you wanted to, you could modify the input box name, add a position or relation, or add a checkpoint. For details, see Record an AI-based test.

  7. Click the highlighted Password input box, and enter a password.

    AI Object Record automatically adds the step that types a password to the Password input box to the Editor.

    Note: The examples in this tutorial use the credentials for Mary Sanchez, a fictional tester. Your code may look slightly different, and show your credentials instead.

  8. Click the highlighted SIGN IN button. After the corresponding step is added successfully, click Exit on the AI Object Record toolbar to return to UFT One.

Back to top

View your steps in the Editor View

In the Editor, your steps for the Login action should look like this (the code may differ slightly):

AIUtil.SetContext Browser("creationtime:=0")
AIUtil("profile").Click
AIUtil("input", "Username").Type "msanchez"
AIUtil("input", "Password").Type "1234Aa"
AIUtil("button", "SIGN IN").Click

Back to top

Next steps: