Window Declarations contain information
Phantom uses to identify and communicate with a window. This information
is contained in a special file which is included in the script via the
While windows can be accessed using the MainWin function
or through window handles, it can often be beneficial to use the window
declarations file when dealing with large, complex windows. The declarations
file, recorded using the window declarations recorder, contains the
properties of the window and all child windows, and makes them immediately
available to the script.
The declarations file itself is an ASCII text
file. The file contains a hierarchal structure of the window and all
child windows and menus. The file can be edited manually with any text
editor (not recommended) or by using the window declarations recorder's
built-in editor. Additionally, the Phantom Test Driver (version 2.0
and later) also has a built-in window declarations editor and viewer.
Each element in a Window Declarations file corresponds
to a window or control. The exceptions to this are the menu and
menu item. Menus and menu items correspond to the menu hierarchy
of the window, each element representing a menu element. There
is one top-level menu element that does not correspond to a window menu,
but informs the interpreter that the following information represents
a menu item and not a window or control. This is done because
menus require different processing than windows and controls.
The format of a Window Declarations file is very
important. The tab spacing for each element is used to determine the
order of the windows in the hierarchy. Therefore, use caution when manually
editing a Window Declarations file and make sure the tab spacings are
consistent with the hierarchy. Also, always use an ASCII text editor
that represents tabs as tab characters and not spaces.
See Also: The
Window Declarations Recorder, Elements,
Using Window Declarations,