Add Logout steps in the Editor

This exercise describes how to manually add steps in the Editor that log out of your Advantage Online Shopping account after completing your purchase.

Add steps to log out

This procedure describes how to enter steps manually into the Editor. To do this, you need to understand the hierarchy of the test objects on your web page, and their names and values. (Object names may differ, depending on your unique test parameters, such as user name.)

Do the following:

  1. In UFT One, open the Logout action, either from the Solution Explorer, or the canvas.

  2. If the Keyword View is displayed, switch to the Editor ().

  3. In the Editor, enter the word Browser to start your first step.

    Start with this because you know that your highest parent object in this step is a browser window, with a specific name.

  4. After Browser, add an open parenthesis (.

    There's only one Browser object in your object repository, so UFT One enters it automatically:

    Browser("Advantage Shopping"

  5. Do the same to enter the Page object next.

    1. After the last set of quotes, enter a closed parenthesis ), and then a period . .

    2. Then, enter the word Page, and another open parenthesis (.

      Browser("Advantage Shopping").Page(

      There's also only one Page object available, so UFT One enters it automatically:

      Browser("Advantage Shopping").Page("Advantage Shopping"

  6. Now, you'll need to add the test object you want to access next, which will be the link to open the USER dropdown menu.

    Use the Editor's Intellisense feature to help you find the object. In the Editor, enter a close parenthesis ) after the last set of quotes, and then a period:

    Browser("Advantage Shopping").Page("Advantage Shopping").

    UFT One displays a list of available options to select.

  7. Double-click the Link item, and add another open parenthesis (.

    UFT One lists the two link items available. Double-click the one that starts with your username.

    For example:

    Browser("Advantage Shopping").Page("Advantage Shopping").Link("msanchez My account My"
  8. You want UFT One to click this link object in this step. So, add a close parenthesis and a period )., and then double-click the Click item in the dropdown that appears.

    Your first step looks like this:

    Browser("Advantage Shopping").Page("Advantage Shopping").Link(",<your_login_name> My account My").Click
  9. Repeat the previous steps to click the second link in the object repository, the Sign out link object.

    Tip: Add each element of the step manually, as you did for the first step. Alternatively, just copy and paste the first step, and delete the content starting from the open parenthesis ( after the word Link.

    Add the open parentheses ( back in, and select the Sign out link object instead. Add your close parenthesis and a period )., and select the Click method.

    Your second step looks like this:

    Browser("Advantage Shopping").Page("Advantage Shopping").Link("Sign out").Click
  10. Save your test.

Back to top

Editor sample

Your entire action consists of two steps, and looks like this:

Browser("Advantage Shopping").Page("Advantage Shopping").Link("<your_login_name> My account My").Click
Browser("Advantage Shopping").Page("Advantage Shopping").Link("Sign out").Click

Back to top

Keyword View sample

Switch to the Keyword View () to see the steps in a grid view.

Back to top

Next steps: