Using Non-Component Locators: Using an Existing Locator


This section describes the steps to follow to use a locator while recording a test, but doesn't give you an exercise to run. This is because in order to run a locator and see it work, you need to have an application that uses non-components (the JavaStar term for widgets that JavaStar can't "see").

If you would like to do an exercise using a non-component locator, please take the next t utorial lesson, Testing JFC Components.

To use a locator when running a test, make sure the locator directory is in your Additional classpath setting.

This procedure assumes you have your application running and have the Record/Playback window open.

  1. In the Record/Playback window, click Record.
    The Record test script window is displayed.

  2. In the Test name field, provide the name of your script.

  3. In the Non component locators field, either type in the locators you want or click Locator List to browse for them.
    If you type the locators in, be sure to give the package name (if any) and put a delimeter between each locator. On Windows systems, use a semi-colon as a delimeter; on UNIX systems, use a colon.
    If you use the Select Non-Component Locators dialog window to find the locators, you need to navigate to the correct directory using the Select an Item panel to the left. If you are using a JavaStar-supplied locator, or if you are storing your locators in the same directory as the JavaStar locators,

    1. Click on the JavaStar folder icon along the top of the Select an Item panel.

    2. Click on the plus sign to expand the folder, then scroll down to find the contrib folder.

    3. Expand the contrib folder and double-click on the locators sub-directory to make it the only folder displayed.

    4. Expand the locators folder.

    5. Click on a locator you want to reference, then click the Add to List button in the Edit List panel to the right.

    6. Continue for any other locators you need to add.
      See Figure 9-1 for an example of how the window should look.

    7. Click OK.

      Select Non-Component Locators dialog window.

  4. If you need to specify files for Record with map files, or to toggle on Record with delays, do so now.

    Record test script dialog with locator information provided

  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.