Locators for Non-Components: Referencing Locators in JavaStar


If your application or applet requires a locator, you can include the names of the locators in your project file. For instructions, see the section "Defining Locators, Declaration Classes, and Text Map Classes" in the chapter "Creating Project Files."

You can also define locators in the Record Test Script dialog that is displayed when you begin recording a script. You can type the package.class name in or choose the locator you want from a list.

Typing the Locator into the Field

  1. In the Record/Playback window, click Record.
    The Record Test Script dialog opens. See Figure 16-1.

  2. Type the name of the locator class you want to use into the Non component locators field.
    If you have more than one locator, use the Locator list. function to build a list.

    Record Test Script dialog with a locator provided

Using the Locator List

  1. Click the Locator list button in Record Test.
    A Select Non-Component Locators dialog opens. See Figure 16-2.

    Locator List

  2. In the Select an item panel, navigate to the \contrib\locators directory and open the directory.

  3. Select the name of the locator class you want to use.
    The locator appears in the Edit list panel, under Current Item.

  4. Add the locator to the list by clicking Add to list.
    The locator now appears in the Path list panel and in the list box of Edit list. If you have multiple locators listed, you can move then up or down on the list, or delete them, using the buttons at the bottom of the Edit list panel.

  5. Click OK.



Send feedback to JavaStar-feedback@suntest.com
Copyright © 1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303. All rights reserved.