Preparing to Use JavaStar: Starting Your Application or Applet
Before you can create test scripts or generate declarations for your program, you need to start up the application or applet you plan to test. If you included this information in the currently loaded project file, you don't need to provide it again. You can always override your project file settings for a session if you choose.
The settings you enter into the Create Test Script dialog window stay in effect while the Record/Playback window is open and the application or applet is running. These settings are not saved to the project file; use the Project Settings screen to save changes to the file.
- From the main menu, click Create script.
This brings up the Create Test Script dialog window.

Create Test Script dialog--showing Application fields
This window has two tabs: Application/Applet and Advanced. Use the Application/Applet tab to specify the information specific to your test program. Use the Advanced tab to specify the path to the program (if it is not already defined in your CLASSPATH
setting) and to change directory settings from your defaults.
- Specify the type of program you are running: Application or Applet.
The fields shown on this tab change depending on your choice. When you click on the Applet checkbox, the screen changes to show new fields. See Figure 2-3.

Create Test Script Dialog--showing Applet fields
- Fill in the fields as appropriate to your test program.
For an application, you need to define:
Application information fields
Field
|
Description
|
Class
|
The class name of the Java application you want to test. Either enter the name (without the .class extension) into the text field, or use the Browse button to locate the application by navigating through the directory structure. Make sure you use a fully-qualified class name--for example, if your class is part of a package, specify the package here, too.
For example, if your application is in a package named beta and the name of the main class is dialer.class , you would type beta.dialer into this field.
|
Args
|
Any arguments you want to pass to the application under test.
|
For an applet, you need to define:
Applet information fields
Field
|
Description
|
URL type
|
Choose between file url, http url, and Local.
- Choose file url on Windows systems to specify a local directory and filename for the
.html page that runs your applet.
- Choose http url when you need to run an applet remotely across the web.
- Choose Local when you need to specify a local directory path and filename for the
.html page that runs your applet. The local option works best in UNIX environments; use file url for Windows environments.
|
HTML file
|
The location of the web page containing the Java applet you want to test. Either enter the location (using a prefix) into the text field, or use the Browse button to locate the file by navigating through the directory structure.
|
- Check the Advanced settings to make sure they are correct for the script you want to create.
You can skip this step if you are already sure you test program is in the CLASSPATH and that your directory defaults (as specified in Environment options) are appropriate for the script you want to create.
To check these settings, click the Advanced tab. The screen changes to show advanced options.

Advanced tab on the Create Test Script dialog
You can optionally define or change any of these fields:
Field
|
Description
|
Additional classpath
|
Any additional directories, .zip , or .jar you want to add onto the existing CLASSPATH variable definition. This must include the path to any applications or applets you want to test, tests scripts you want to execute, and any map files you want to use.
When specifying a CLASSPATH , use a semi-colon for a separator if you are running under Windows, and use a colon for a separator on UNIX platforms.
|
Java arguments
|
Any default flags for either JVM or the Java compiler that your program under test require.
|
Log file
|
The filename JavaStar creates for writing out results. By default, JavaStar uses the filename Default.log .
|
Work directory
|
The directory where JavaStar stores the scripts, result logs, and comparison directories your scripts generate.
|
Results directory
|
The directory where JavaStar creates the gold file comparisons and results directory.
|
JST path
|
The directories you want JavaStar to search when finding the scripts and JSTs necessary to run a JST. When listing multiple directories, use a semi-colon for a separator if you are running under Windows, and use a colon for a separator on UNIX platforms.
|
- Click Start.
JavaStar launches your program and opens the JavaStar Record/Playback window (shown in Figure 2-5.) From here, you can playback a script, record a new script, interact with the application without recording, and generate declarations for your GUI.
If JavaStar puts up an error message instead of launching the program you want to test, see If Your Application Does Not Start for ways to resolve the problem.

Record/Playback window.
If Your Application Does Not Start
Here are some possible error messages you might get, and how to resolve them:
There is some problem accessing the class classname. Either:
1. It is not in the CLASSPATH.
2. It is being accessed in the wrong way.
(e.g. String is invalid, java.lang.String is correct.)
Possible solutions:
- Make sure your application path is included in the additional classpath field. Check the entry for this field in the Advanced tab. If you typed the path in directly, you might try using the Browse button to navigate to the directory, so you can be sure you have the latest path.
- Check that you spelled the application name correctly in the Class field of the Application/Applet tab. Do not include the
.class
extension. Make sure this class is the "main" class of your application. Use Browse to navigate to the directory and make sure the .class
file is still there.
- Verify that you are using a fully-qualified class name. If your class is within a package, be sure to type packageName.className.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.