background image
<< Porting Tests - Supporting GUI-specific captions | Porting Tests - Supporting different implementations of the same control >>
Porting Tests - Supporting extra controls
<< Porting Tests - Supporting GUI-specific captions | Porting Tests - Supporting different implementations of the same control >>
User's Guide
273
13 P
ORTING
T
ESTS
TO
O
THER
GUI
S
Supporting extra controls
Deciding which form
of tag to use
When an object's caption or label changes on a different GUI, it is usually
preferable to use multiple tags, each based on the GUI-specific label or
caption, instead of using the index. Not only does it make your declarations
easier to understand, but it shields your testcases from changes to the
sequence of child objects. For example, if the Exit item changes so that it is
the fourth item and not the fifth, your testcases will still run.
Supporting GUI-specific menu hierarchies
Two common
differences in menu
hierarchy
When an application is ported, there are two common structural differences
in the menu hierarchy:
The menu bar contains a platform-specific menu.
A menu contains different menu items.
Example: a platform-
specific menu
To illustrate the first case, consider the Microsoft Windows system menu or
the Macintosh Apple menu. SilkTest recognizes these kinds of standard GUI-
specific menus and includes the appropriate GUI specifier for them when you
record declarations, as shown in this declaration for the Macintosh Apple
menu:
mac Menu AppleMenu
For menus that SilkTest does not recognize as platform-specific, you should
preface the window declaration with the appropriate GUI specifier.
Example: different
items on a menu
To illustrate the second case, suppose that the Edit menu for the Text Editor
application has a menu item named Clear which appears on the Windows
version only. The declaration for the Edit menu should look like this:
Menu Edit
tag "Edit"
msw MenuItem Clear
tag "Clear"
MenuItem Undo
tag "Undo"
Supporting extra controls
You may find that the controls within a dialog are slightly different from
platform to platform. For example, consider the Open dialog of the Text
Editor application.