Recording window declarations
10
Working with Java Applications
Step 5: Recording window declarations for the Drawing Area
At this point, we assume that you recorded a class for the canvas and that the Drawing Area window is
still open in the sample Java application.
To record window declarations:
1 Create a new test frame file. In SilkTest, select File/New, select Test Frame in the New dialog, and
click OK. The New Test Frame dialog opens.
2 Select Test Application in the Application field and edit the File name field so it reads:
<SilkTest install directory>\extend\draw.inc
3 Click OK. The 4Test Include File draw.inc opens and is automatically loaded in SilkTest.
4 Manually load the class include file canvas.inc, which you created in Task 5. In SilkTest, select
Options/Runtime, click the Add button in the Runtime Options dialog, select canvas.inc from the
extend directory, and click OK. The file canvas.inc is added to the Use Files field.
5 Click OK to close the Runtime Options dialog.
6 With draw.inc as the active window, select Record/Window Declarations.
7 Move your mouse pointer over the title bar of the Drawing Area window. When DrawingArea
appears in the Identifier field, press Ctrl-Alt. Declarations are captured for the Drawing Area
window and all of its controls.
8 Click DrawingCanvas in the Window Declaration list and change the name in the Identifier field to
Canvas.
9 Click Paste to Editor to record the declarations in draw.inc.
10 Click Close to close the Record Window Declarations dialog.
11 Click Exit to close the Drawing Area window.
12 Save and close draw.inc.
Now, you're ready to prepare the test script file. Continue to Step 6: Preparing the test script file.