background image
<< Custom Objects - Irregularly sized or spaced controls | Custom Objects - Supporting custom text fields >>
Custom Objects - Supporting nongraphical controls
<< Custom Objects - Irregularly sized or spaced controls | Custom Objects - Supporting custom text fields >>
322
User's Guide
17 S
UPPORTING
C
USTOM
O
BJECTS
Supporting nongraphical controls
Example The following declaration specifies that the FileOpen icon on the
tool bar is located at position 74, 22.
CustomWin FileOpen
mswdos tag "[PaintWindow]#1/(74,22)"
Procedure To add the x,y coordinates to a declaration:
1
Position the cursor in the declaration at the end of the tag to which you
want to add coordinates.
2
Type a slash character (/ ).
3
Select Record/Window Locations to open the Record Window Locations
dialog.
4
Track the cursor over the object.
The dialog displays the name of the object and its x,y coordinates relative
to the screen, the frame (the main window and its window decoration),
and the client (the main window minus its window decoration).
5
Press Ctrl+Alt to freeze the declaration.
6
Select the Client radio button, if not already selected.
7
Press the Paste to Editor pushbutton.
8
Press the Close pushbutton.
Using the modified
declaration
In a script, to use the Click method on this icon, you use this command:
app-name.FileOpen.Click ()
Supporting nongraphical controls
Options for
nongraphical, custom
controls
If your application uses a nongraphical control that does not map to any of
those supported by SilkTest, you have these options:
·
If you have the SilkTest Extension Kit, you can add full support for the
custom object to SilkTest. Refer to the extension kit guide for more
information.
·
If the application's developer created DLLs to interact with the custom
object, you can call the DLL functions from a script. For more
information, see Chapter 24, "Calling Windows DLLs From 4Test
Scripts".