While recording a script, you can pause to edit the script, inserting Java code or changing statements as necessary. Using the insert references option, you can select a component in your program under test and have JavaStar insert the reference automatically, speeding up your code additions and improving accuracy. When you're done, you can compile and save your changes, then continue on recording events as before.
The Script Editor that JavaStar opens in the Record/Playback window is not the same as the window you get when you click Edit Test Script in the JavaStar main menu. The Record/Playback editor includes a subset of the main Script Editor features. It also includes the Insert Reference feature, one specific to editing in record mode.
This section describes how to enter the script editor from record mode and how to use the Insert Reference feature. For information about the common features of both editors--Class Browser, Find/Replace, and Go to Line--see the chapter "Editing Tests."
Script editor in the Record/Playback window
You don't need to compile your script because JavaStar will compile and check the code itself when you stop recording.
Now you can continue recording events as before, with your code changes incorporated into the script.
With Insert Reference, you select a component and provide a variable name, and JavaStar then inserts a properly casted declaration, assigned to the variable name you specified. This is useful when you want to write your own verification code for more complex methods, such as methods that require parameters, or that return non-basic Java values.
To insert a declaration into a script you are recording:
Insert Reference dialog
The declaration for the component appears in the lower text box of the Select for Declaration dialog.
Figure 4-11 shows a Select for Declarations dialog with a component selected and a name provided.
Insert Reference dialog with fields filled in
You can now, in subsequent code, refer to the component solely by the name you defined.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.