Running Tests: Playing Back a Test Using Run Test


  1. From the JavaStar main menu, click Run test.
    This brings up the Run Test dialog window (see Figure 9-1 on page 86). This window has three tabbed sections:

  2. Supply a test name and, if required, test arguments.
    This is the minimum of information you must supply. When typing test arguments, be sure to put double-quotation marks around any single argument that contains whitespace or a special character. For example:
    "Alix North" 32 writer "San Francisco"

    Note - Using the Browse button, you can navigate through the directory structure and select a script (.class file, not .java) or a JST (.jst) to run. JavaStar inserts the name of the file you select into the Test Name field.

  3. To change the view option, click the View tab and make a selection.
    Figure 9-2 on page 87 shows the Run Test window with the contents of the View tab to the forefont. If you want to change the current setting, select another options (usually Show Application and playback window by default).
    If you choose Don't show playback window, none of the JavaStar windows are displayed while playback is in process--you only see your application or applet under test. You do not have any JavaStar Record/Playback controls available to interrupt the test run. As soon as the test finishes, JavaStar closes the program under test. You need to click View Test Results in the main menu to see what happened. If, for some reason, your test throws an exception that isn't handled by your test, your program may seem to hang. You can terminate the playback process using the Status Monitor, then view results to see what problem the log file reports.
    If you choose Don't show application or playback window, neither the JavaStar windows nor your program under test is displayed during the test run. This is perhaps the trickiest selection, because it's harder to find out when your test is done. You can always use the Monitor Status option of the main menu to track progress. When the test is complete, you can view results using the results viewer.

    View options of the Run Test window

  4. To check your CLASSPATH setting, define a log filename, and verify that your directory settings are correct, click the Advanced tab to bring its contents forward.
    Figure 9-3 on page 89 shows the Advanced tab options. The first option--Additional classpath--is perhaps the most important. This is where you specify the path to the application or applet you want to run. If this is not set correctly, JavaStar cannot start the application.

    Note - If you are using Windows and launched JavaStar by double-clicking on the icon, the Work directory, Results directory, and Jst Path are set to ..\javastar\work (where ... represents the directory where you installed JavaStar). This is true even if you already set options to use different directories. You can change these fields to reflect the directories you want to use, and the next time you create a script, you'll see your updated settings.

    Run Test Advanced options

    Option Description
    Additional classpath Any additional directories you want to add onto the existing CLASSPATH variable definition, including the path to the application or applet you are testing.
    Java args Any Java flags required by the test program. See JavaStar Command Reference for a list of valid flags.
    Log filename The log containing the results of this test run. If you don't provide a log name, JavaStar will name the file <testname>.log by default.
    Work directory The directory where JavaStar reads and writes scripts by default.
    Results directory The directory JavaStar uses to store the fail directory, gold directories, and log file.
    JST Path The paths JavaStar searchs when looking for JSTs and the scripts they reference.

    Advanced options of the Run Test window

  5. Click Start.
    JavaStar opens the application or applet under test, along with the JavaStar Record/Playback window. The test begins executing immediately. If you are running a JST, Javastar also opens the JST Runner (see Figure 9-4 on page 90). This window shows the JST in graphical form. While the test executes, JavaStar flashes each node as it executes so you can follow the progress.

    JST Runner

    Note - If the JST runner encounters a node that references a script not in the CLASSPATH, testing stops and the log indicates that the class for the node could not be found.

  6. When test execution ends, click Quit to close all playback windows.
    If you've chosen an option that displays the JavaStar GUIs, you can review the log in the Record/Playback window before quitting. You can also quit and choose View Test Results from the JavaStar main menu, then view your results through a reporting interface.



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