|
Global object. Use it to perform actions not related to a particular object. You do not need to record or learn this object, it is always automatically available in any test.
Property Summary
Property
|
Description
|
lastPid
|
PID of last process executed using call to a DoLaunch.
|
Action Summary
Action
|
Description
|
DoAnalogPlay
|
Performs Analog Playback of events recorded in a file.
|
DoAppActivate
|
Activates window with the specified title.
|
DoClick
|
Performs mouse click at the current position.
|
DoInvokeTest
|
Invokes another test script (as sub-test).
|
DoKillByName
|
Terminates a given process.
|
DoKillByPid
|
Terminates a given process.
|
DoLaunch
|
Executes a command specified in cmdLine.
|
DoMessageBox
|
Shows message box (popup message) to a user.
|
DoMouseMove
|
Moves mouse to the specified position.
|
DoSendKeys
|
Sends series of keystrokes to a currently focused application.
|
DoSleep
|
Pauses execution for given number of milliseconds (1000 = 1 second).
|
DoTrim
|
Trims given string (removes left and right whitespaces).
|
DoWaitFor
|
Waits for object specified by id to be available.
|
GetCurrentDir
|
Gets current directory path.
|
GetFullPath
|
Constructs an absolute file name using current directory of the test.
|
GetOsOwner
|
Reads OS registered owner from the registry.
|
GetOsPath
|
Reads OS root path from the registry.
|
GetOsType
|
Reads OS type from the registry.
|
GetOsVersion
|
Reads OS service pack version from the registry.
|
GetSpecialFolderPath
|
Retrieves the system special folder path.
|
Property Detail
lastPid
PID of last process executed using call to a DoLaunch.
Action Detail
DoAnalogPlay(path, left, top)
Performs Analog Playback of events recorded in a file.
Parameters:
Name
|
Type
|
Description
|
path
|
String
|
This is a path to a file with recorded analog events.
|
left
|
Number
|
X-coordinate of top-left corner of the analog area.
|
top
|
Number
|
Y-coordinate of the top-left corner of the analog area.
|
DoAppActivate(title)
Activates window with the specified title. I.e. Global.DoAppActivate("Calculator") will bring running instance (if any) of Windows Calculator to the foreground.
Parameters:
Name
|
Type
|
Description
|
title
|
|
|
See:
MSDN Article for AppActivate
DoClick(clickType)
Performs mouse click at the current position.
Parameters:
Name
|
Type
|
Description
|
clickType
|
String
|
Type of click, can be one of "L" - left click, "LD" - double left click, "R" - right click, "RD" - double right click, "M" - middle click, "MD" - double middle click, "N" - don't click.
Optional, Default: "L".
|
DoInvokeTest(pathToTest, optionalParams)
Invokes another test script (as sub-test). The subtest should have the set of libraries as calling test. Otherwise it may lead to a conflict.
Parameters:
Name
|
Type
|
Description
|
pathToTest
|
String
|
absolute or relative path to a subtest
|
optionalParams
|
Object
|
|
Returns:
'true' if test passed.
DoKillByName(processName)
Terminates a given process.
Parameters:
Name
|
Type
|
Description
|
processName
|
String
|
Name of the process.
|
Returns:
'true' if the process was terminated, 'false' otherwise.
DoKillByPid(pid)
Terminates a given process.
Parameters:
Name
|
Type
|
Description
|
pid
|
Number
|
ID of the process.
|
Returns:
'true' if the process was terminated, 'false' otherwise.
DoLaunch(cmdLine, wrkDir, attachIfExists)
Executes a command specified in cmdLine.
Parameters:
Name
|
Type
|
Description
|
cmdLine
|
String
|
Command line to execute.
|
wrkDir
|
String
|
Working directory for the new process.
Optional.
|
attachIfExists
|
Boolean
|
Try to find existing process before starting new one. If no process found then new one is created.
Optional.
|
Returns:
ID of the new process.
DoMessageBox(prompt, buttons)
Shows message box (popup message) to a user.
Parameters:
Name
|
Type
|
Description
|
prompt
|
String
|
Message to display
|
buttons
|
Number
|
A value or a sum of values that specifies the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. Default value is 0 0 = vbOKOnly - OK button only 1 = vbOKCancel - OK and Cancel buttons 2 = vbAbortRetryIgnore - Abort, Retry, and Ignore buttons 3 = vbYesNoCancel - Yes, No, and Cancel buttons 4 = vbYesNo - Yes and No buttons 5 = vbRetryCancel - Retry and Cancel buttons 16 = vbCritical - Critical Message icon 32 = vbQuestion - Warning Query icon 48 = vbExclamation - Warning Message icon 64 = vbInformation - Information Message icon 0 = vbDefaultButton1 - First button is default 256 = vbDefaultButton2 - Second button is default 512 = vbDefaultButton3 - Third button is default 768 = vbDefaultButton4 - Fourth button is default 0 = vbApplicationModal - Application modal (the current application will not work until the user responds to the message box) 4096 = vbSystemModal - System modal (all applications wont work until the user responds to the message box) We can divide the buttons values into four groups: The first group (0�5) describes the buttons to be displayed in the message box, the second group (16, 32, 48, 64) describes the icon style, the third group (0, 256, 512, 768) indicates which button is the default; and the fourth group (0, 4096) determines the modality of the message box. When adding numbers to create a final value for the buttons parameter, use only one number from each group
Optional, Default: 0.
|
Returns:
A number representation of a button pressed by user:
| vbOK | 1 | OK button was clicked. |
| vbCancel | 2 | Cancel button was clicked. |
| vbAbort | 3 | Abort button was clicked. |
| vbRetry | 4 | Retry button was clicked. |
| vbIgnore | 5 | Ignore button was clicked. |
| vbYes | 6 | Yes button was clicked. |
| vbNo | 7 | No button was clicked. |
DoMouseMove(x, y)
Moves mouse to the specified position.
Parameters:
Name
|
Type
|
Description
|
x
|
Number
|
Absolute X-coordinate of the target mouse position.
|
y
|
Number
|
Absolute Y-coordinate of the target mouse position.
|
DoSendKeys(keys)
Sends series of keystrokes to a currently focused application.
Parameters:
Name
|
Type
|
Description
|
keys
|
String
|
A sequence of keystrokes.
|
See:
MSDN Article for SendKeys
DoSleep(millis)
Pauses execution for given number of milliseconds (1000 = 1 second).
Parameters:
Name
|
Type
|
Description
|
millis
|
Number
|
Number of milliseconds to sleep.
|
DoTrim(str)
Trims given string (removes left and right whitespaces).
Parameters:
Name
|
Type
|
Description
|
str
|
String
|
String to trim.
|
Returns:
Trimmed string.
DoWaitFor(objectId, timeout)
Waits for object specified by id to be available. Function returns if object was found or timeout.
Parameters:
Name
|
Type
|
Description
|
objectId
|
String
|
ID of object to wait for.
|
timeout
|
Number
|
Maximum time to wait.
|
Returns:
Found object or 'false'.
GetCurrentDir()
Gets current directory path.
Returns:
Path of the current directory.
GetFullPath(fileName)
Constructs an absolute file name using current directory of the test.
Parameters:
Name
|
Type
|
Description
|
fileName
|
String
|
Name of a file.
|
Returns:
Absolute file name.
GetOsOwner()
Reads OS registered owner from the registry.
Returns:
OS registered owner.
GetOsPath()
Reads OS root path from the registry.
Returns:
OS root path without the trailing backslash, e.g. "C:\Windows".
GetOsType()
Reads OS type from the registry.
Returns:
OS type.
GetOsVersion()
Reads OS service pack version from the registry.
Returns:
Service pack version.
GetSpecialFolderPath(folder)
Retrieves the system special folder path.
Parameters:
Name
|
Type
|
Description
|
folder
|
String
|
The system special folder name as defined in .NET Environment.SpecialFolder enum, e.g. "ProgramFiles".
| Possible values: |
| ApplicationData | The directory that serves as a common repository for application-specific data for the current roaming user. |
| CommonApplicationData | The directory that serves as a common repository for application-specific data that is used by all users. |
| CommonProgramFiles | The directory for components that are shared across applications. |
| Cookies | The directory that serves as a common repository for Internet cookies. |
| Desktop | The logical Desktop rather than the physical file system location. |
| DesktopDirectory | The directory used to physically store file objects on the desktop. |
| Favorites | The directory that serves as a common repository for the user's favorite items. |
| History | The directory that serves as a common repository for Internet history items. |
| InternetCache | The directory that serves as a common repository for temporary Internet files. |
| LocalApplicationData | The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user. |
| MyComputer | The "My Computer" folder. |
| MyDocuments | The "My Documents" folder. |
| MyMusic | The "My Music" folder. |
| MyPictures | The "My Pictures" folder. |
| Personal | The directory that serves as a common repository for documents. |
| ProgramFiles | The program files directory. |
| Programs | The directory that contains the user's program groups. |
| Recent | The directory that contains the user's most recently used documents. |
| SendTo | The directory that contains the Send To menu items. |
| StartMenu | The directory that contains the Start menu items. |
| Startup | The directory that corresponds to the user's Startup program group. |
| System | The System directory. |
| Templates | The directory that serves as a common repository for document templates. |
|
Returns:
System specified folder path without the trailing backslash, e.g. "C:\Program Files".
|