Record your first action - Login steps

This exercise describes how to use AI 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 Record to record the Login action.

Do the following:

  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. In UFT One, select Record > Record and Run Settings. On the Web tab, select Record and run on any open browser. Click OK, and save your test.
  3. Double-click the Login action to open it, and then click the AI Record toolbar button .

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

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

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

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

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

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

  7. Click the highlighted Username input box, and enter a username. The AI 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.

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

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

  9. Click the highlighted SIGN IN button. Once the corresponding step is added successfully, click Exit on the AI 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("input", "Username").Type "msanchez"
AIUtil("input", "Password").Type "1234Aa"
AIUtil("button", "SIGN IN").Click

Back to top

Next steps: