Phantom Documentation

[Help Home] [Phantom Home]
Generic Windows

Windows commands that were recorded are different than window commands using Window Declarations. A window command that is recorded is a generic window that includes the type of window, the window tag, and the window class. All properties of a regular window declaration can be used on a recorded window, including wildcard characters (*), and recorded windows are treated the same as Window Declarations by the Phantom interpreter. The syntax of a recorded window is:

MainWin(WindowTag, WindowClass).WindowType(WindowTag, WindowClass)....Action();

Where,

WindowTag is the text or numerical tag of the window.  If it is text, it must be in quotes (").

WindowClass is the class name of the window (ex: Button), and must be in quotes (").  A defined class can be used here.

Action is the action, or function  to perform on the window

Usually this information will be created by the recorder (Ex: Phantom Test Driver, or Phantom Sidekick) and will not need to be manipulated unless wildcards are desired in the WindowTag or WindowClass. Generic declarations can also be used directly in a script if using a window declarations file is not desired.

MainWin is considered a function in Phantom versions 2.0 and later. It returns a window data type

Example Code

System("c:\\windows\\system32\\notepad.exe");
MainWin("*", "Notepad").MainWin(1,"Edit").TypeKeys("Hello");

window w = MainWin("*", "Notepad");
w.Maximize();



See Also: Window Declarations, Window Types, MainWin, MainWin (member)


Copyright 2000-2011 Phantom Automated Solutions