Add steps in the Editor

This exercise describes how to add steps manually in the Editor that log out of your AdvantageDEMO 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.

Do the following:

  1. In UFT, 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 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 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 displays a list of available options to select.

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

    UFT 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 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("msanchez 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. Alternately, 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("msanchez 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: