Each test script implements the Script
class to define the application it needs to run, start-up information, argument details, and the actual test itself. When you create or edit a Script, you must be sure to maintain the Script structure, or your test may not compile or run. A Script is a Java program; it must compile and run in Java. In addition, you must ensure that the methods JavaStar requires are in place.
/* Generated by JavaStar Java GUI Testing Tool
*/
import suntest.javastar.lib.*;
import java.awt.*;
// You may add import statements here
public class EmptyScript extends Script {
private static String[] Args = {"file:/D:\\JavaStar\\examples\\SwingSet\\Application\\SwingSetApplet.html"};
public String[] getAppArgs(){ return Args; }
public String getAppClass(){ return "suntest.javastar.applet.JSAppletViewer"; }
public void run() throws Throwable {
suntest.javastar.applet.JSAppletViewer.main(Args);
}
public void play(String[] args) throws Throwable {
//YOU ADDRESS THE API HERE
}
}
When you edit a script or create one manually:
getAppArgs()
, getAppClass()
, run()
, and play()
).
suntest.javastar
or java.awt
packages.
getAppClass()
returns a string that matches the name of your application's main class. This is an issue only if you're creating the script manually.
play()
method or add other methods.
In general, you only need to add import statements and edit or add to the play()
method. If you generate an empty script through the Record/Playback window, all other required fields and methods will be in place.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.