For this part of the lesson you'll create a small script that exercises several components. Because you'll be re-designing TestNameDB
in the next lesson, this test serves as an example and is not one you'll keep in the revised test suite. All the tests you create from this point in the tutorial will use the declaration files.
Note - If you want to use declaration files with existing tests, you can modify the code manually to incorporate them. For instructions, see the chapter, "Generating and Using Declarations" in the JavaStar User's Manual.
namedb
application.SimpleAdd
.\tutorial\NameData
directory.MainWin.class
.MainWin.class
is added to the list in the right panel and to the field at the bottom of the window.
NamesWin.class
and SearchWin.class
.test.db
file.test.db
, and click Open again.
play()
method of the script (shown in the log panel to the right of the Record/Playback window) to see the declarations.play()
should look similar to this:
public void play(String[] args) throws Throwable {
NameData.MainWin.Open().buttonPress();
NameData.MainWin.frame().dialog("Open").relativefile(".", "test.db");
NameData.MainWin.Clear().buttonPress();
NameData.MainWin.nameTextField().mousePressed(27,11,16);
NameData.MainWin.nameTextField().mouseDragged(25,10,0);
NameData.MainWin.nameTextField().mouseReleased(25,10,16);
NameData.MainWin.nameTextField().typeString("Alix", 0, 0);
NameData.MainWin.nameTextField().keyPressed(9,'\t',0); /* Tab */
public void play(String[] args) throws Throwable {
JS.frame("Name Database").button("Open").buttonPress();
JS.frame("Name Database").dialog("Open").relativefile(".", "test.db");
JS.frame("Name Database").button("Clear").buttonPress();
JS.frame("Name Database").member("namedb").member("java.awt.TextField", 0).mousePressed(21,5,16);
JS.frame("Name Database").member("namedb").member("java.awt.TextField", 0).mouseReleased(21,6,16);
JS.frame("Name Database").member("namedb").member("java.awt.TextField", 0).typeString("Alix", 0, 0);
JS.frame("Name Database").member("namedb").member("java.awt.TextField", 0).keyPressed(9,'\t',0); /* Tab */
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.