Cogitek RIATest 3 Documentation Copyright © Cogitek Inc.

Global Object

There is a unique global object, which is created before control enters any execution context. Methods and properties of Global object are accessible directly from script.

Methods

MethodDescription

assert

assert(argument[,failMessage])
Assert that argument evaluates to 'true'. Outputs verification passed or failed message to log. If assertion fails current script execution is aborted.

assertEqual

assertEqual(argument1,argument2)
Verify that argument1 strictly equals argument2. If arguments are not primitive types (e.g. are objects or arrays) all sub-components are verified to be equal as well (unlike == operator). Outputs verification passed or failed message to log. If assertion fails current script execution is aborted.

closeBrowser

closeBrowser([browserProcess]);
Close browser window. If browserProcess is specified appropriate browser will be killed otherwise last open browser will be killed.

externalCall

externalCall(funcName[,arguments,...])
Call function using Flex ExternalInterface.call()
For example: externalCall("window.resizeTo",800,600);
For more information see this page.

fileGetContents

fileGetContents(fileName)
Read entire file contents as a string. File is assumed to be encoded in UTF-8. If file is not found or read error occurs null is returned.

filePutContents

filePutContents(fileName,contents)
Write specified contents string to specified file using UTF-8 encoding. If file exists its content is overwritten. Returns true if operation was successfull.

getEnv

getEnv(variable)
Get environment variable.

getProjectGlobal

getProjectGlobal(key)
Get the value from the project global value map corresponding to the specified key. Must be previously set by setProjectGlobal function.

getProjectOptions

getProjectOptions()
Return current project options.

getSysInfo

getSysInfo()
Get system information object.

getTimer

getTimer()
Return the time since startup of the execution in milliseconds.

getWaitTimeout

getWaitTimeout()
Returns current timeout value for waitFor operator in milliseconds.

isAppConnected

isAppConnected(appId)
Checks if the Application specified by its id is connected.

isEqual

isEqual(argument1,argument2)
Strictly compare argument1 with argument2. If arguments are not primitive types (e.g. are objects or arrays) all sub-components are compared as well (unlike == operator). Returns true if arguments are equal.

isFinite

isFinite(argument)
Returns true if argument is finite number.

isNaN

isNaN(argument)
Returns true if argument is NaN.

isPresent

isPresent(locator)
Checks if the component specified by locator is present.

openBrowser

openBrowser(urlOrPath[, options]);
Open browser window and return a Process object of browser.
urlOrPath must specify url to application or file path to load in browser.
options is a bitwise or-ed mask of various flags.
Use BR_PROJECTLOADTYPE, BR_STANDALONE or BR_USELOADER to specify loading type. Use BR_RIATESTOPTION, BR_SYSDEFAULT, BR_IE, BR_FIREFOX, BR_CUSTOM to specify which browser to open.

parseFloat

parseFloat(string)
Converts the string to a number value.

parseInt

parseInt(string,radix)
Converts the string to an integer value according to the specified radix. Leading whitespace in the string is ignored. If radix is undefined or 0, it is assumed to be 10 except when the number begins with the character pairs 0x or 0X, in which case a radix of 16 is assumed. Any radix-16 number may also optionally begin with the character pairs 0x or 0X.

pause

pause(argument)
Pauses execution of the script for specified number of milliseconds.

putEnv

putEnv(variable,value)
Set environment variable value.

selectApp

selectApp(appId)
Select Application for testing. appId must be string equal to id of Application. Returns true on success.

setErrorMode

setErrorMode(operation,errorMode)
Set operation error mode.
operation must be one of the following: OP_ACTION, OP_PROPERTY_ACCESS, OP_WAITFOR.
errorMode must be one of the following: EM_NOTHROW, EM_THROW_EXCEPTION.

setExecutionDelay

setExecutionDelay(argument)
Set a delay in milliseconds to wait after every action execution. Default value is 0.

setMaxValueNesting

setMaxValueNesting(maxNesting)
Set maximum nesting level for value retrieved from Agent. Default value is 5. Setting too a big value may result in very large object set being retrieved when accessing complex properties of objects (e.g. 'dataProvider' property of a Tree with lots of depth and large collection of items.)

setProjectGlobal

setProjectGlobal(key,value)
Set value in the project global value map and associate it with the key. Project global value map is preserved during execution of the project unlike plain global variables which persist only throughout single script execution.

setWaitTimeout

setWaitTimeout(argument)
Sets current timeout value for waitFor operator in milliseconds.

trace

trace()
Output argument value to message log

verify

verify(argument[,failMessage])
Verify that argument evaluates to 'true'. Outputs verification passed or failed message to log.

verifyEqual

verifyEqual(argument1,argument2)
Verify that argument1 strictly equals argument2. If arguments are not primitive types (e.g. are objects or arrays) all sub-components are verified to be equal as well (unlike == operator). Outputs verification passed or failed message to log.

Found a typo? Have a suggestion? Please submit your request here.