Getting Started with JavaStar: Running the Test


You can playback tests using the Run Test option of the main menu or using the Playback button in the Record/Playback window. However, if you had played your script back immediately after recording it, the results would be added to the same log file that contains your recording log. Mixing these results means less readability and a larger log, so, in general, playing back immediately after recording is reserved for when you want to debug your script.

When you use Run Test, JavaStar creates a new log file and launches the test application again, in a fresh state.

  1. Copy the original sesame.db to test.db, replacing the existing file.
    This ensures that you start with a clean database. You can do this without exiting JavaStar. For example, on a UNIX system, you can copy the file in a shell. In Windows, you can copy the file in Windows Explorer.

    Note - You'll need to copy sesame.db over test.db repeatedly during the course of this tutorial, as you run and re-run tests. You might want to create a batch file or shell script that refreshes the database for you, to save some typing in subsequent exercises.

  2. From the JavaStar main menu, click Run Test.
    The Run Test window opens.

  3. In the Test name field, type TestNameDB.
    In this example, the script does not take any arguments so you can leave the Test args field blank.

  4. Click the View tab to see view options.
    These three check boxes are where you determine whether you want to see the JavaStar windows along with the application window (necessary if you want to use JavaStar controls), just the application window, or neither one.
    Keep Show application and playback window checked so you can watch the progress through the script. If you run a script later on and don't care to use any controls, you can choose the Don't show playback window option. The last option, Don't show application and playback window is more useful when you run tests from the command line. When you're running the JavaStar GUI, you'll need to use the Status Monitor to find out when your script finishes running.

  5. Click the Advanced tab to see more options.
    The advanced options include any additional classpath you need to use for this test run, Java arguments you want to insert, the log file name, the working and results directory, and the JST path. You can leave these with their default values for this test run.

  6. Click Start.
    Because you did not specify a log file name, JavaStar automatically opens a log file using the format testname.log (which, in this case, translates to TestNameDB.log).
    JavaStar opens the Record/Playback window and launches the test application. In contrast with how the Record/Playback window looked while you were recording, it now shows two text panels--one for the JavaStar script that is executing, and the other for the log file. As the script runs, the code scrolls through the upper panel. The current line number shows in the Location information, and this line is also highlighted in the text panel. See Figure 2-10.

    Record/Playback window during playback

At the end of the test, the Record/Playback window stays open, and you can see summary information in the log file panel. See Figure 2-11.

Record/Playback window with test run summary

  1. When the script finishes, quit the Record/Playback window.



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