The main window declaration begins with the 4Test reserved word window. The term window is historical, borrowed from operating systems and window manager software, where every GUI object, for example main windows, dialogs, menu items, and controls, is implemented as a window.
As is true for all window declarations, the declaration for the main window is composed of a class, identifier, and tag or locator.
window MainWin TextEditor multitag "Text Editor" "$C:\PROGRAMFILES\<SilkTest install directory>\SILKTEST\TEXTEDIT.EXE"
Part of Declaration | Value for TextEditor's main window. |
---|---|
Class | MainWin |
Identifier | TextEditor |
Tag | Two components in the multiple tag:
|
window MainWin TextEditor locator "Text Editor"
Part of Declaration | Value for TextEditor's main window. |
---|---|
Class | MainWin |
Identifier | TextEditor |
Locator | " Text Editor "—The application’s caption |
When you record the declaration for your application’s main window and menus, the sCmdLine and wMainWindow constants are created. These constants allow your application to be started automatically when you run your test cases.
mswnt const sCmdLine = "c:\program files\<SilkTest install directory>\silktest\textedit.exe"
const wMainWindow = TextEditor
window MainWin TextEditor multitag "Text Editor" "$C:\PROGRAM FILES\<SilkTest install directory>\SILKTEST\TEXTEDIT.EXE" . . . Menu File tag "File" MenuItem New multitag "New" "$100"Menus do not have window IDs, but menu items do, so by default menus are declared with the tag statement while menu items are declared with the multitag statement.
window MainWin TextEditor locator "Text Editor" . . . Menu File locator "File" MenuItem New locator "@caption='New' or windowId='100'"