background image
<< Test Frame - About dialog declarations | Test Frame - Why change the tags >>
Test Frame - Modifying identifiers and tags
<< Test Frame - About dialog declarations | Test Frame - Why change the tags >>
User's Guide
93
4 R
ECORDING
A
T
EST
F
RAME
Modifying identifiers and tags
About the generic message box declaration
When you create a new test frame, SilkTest also automatically creates a
declaration for a generic message box, one that is valid for any message box
in the application. Therefore, you do not have to record a declaration for
every one of the message boxes (potentially hundreds) in your application.
A message box is a dialog that has static text and pushbuttons, but no other
controls. Typically, message boxes are used to prompt users to verify an
action (such as "Save changes before closing?") or to alert users to an error.
Here is the declaration for the generic message box:
window MessageBoxClass MessageBox
tag "~ActiveApp/[DialogBox]$MessageBox"
PushButton OK
tag "OK"
PushButton Cancel
tag "Cancel"
PushButton Yes
tag "Yes"
PushButton No
tag "No"
StaticText Message
motif tag "#2"
tag "#1"
Why the declaration is
generic
The message box declaration is generic for three reasons:
The dialog's tag specifies that its parent is the current active application.
The most likely names for pushbuttons are accounted for: OK, Cancel,
Yes, and No.
The tag of the message is an index number, not the text of the message.
You can enhance the generic declaration. See "Modifying the message box
declaration" on page 100.
Modifying identifiers and tags
In some instances, you may want to modify the recorded identifiers or tags.
Why change the
identifier
Because an identifier is a logical name, it is arbitrary and can be any name of
your choice. Therefore, if you find the generated identifier too long or not
descriptive enough, you can change it.