| Cogitek RIATest 4 Documentation | Copyright © Cogitek Inc. |
| Method | Description |
|---|---|
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. |
assertMatch |
assertMatch(argument1,argument2) Verify that argument1 matches argument2. If argument2 is RegExp pattern matching is performed. If argument2 is an Object it will be verified that specified properties exist on argument1 and they match specified values.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. |
discardSysLocatorCache |
discardSysLocatorCache() Discard Windows UI Automation cache. |
exitProject |
exitProject([exitCode]) Terminate execution of the project.If RIATest process is called from command line return exitCode (or 0 if ommited). No error is registered when this function is called. |
exitScript |
exitScript() Gracefully terminate execution of the current script and proceed to the next script in the project (if any). No error is registered when this function is called. |
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. |
getLastBrowser |
getLastBrowser() Return Process of the last opened browser (or AUT). This includes browser opened by RIATest automatically or via openBrowser script function |
getMultipleMatches |
getMultipleMatches(locator[,maxResultCount]) Return an array of specialized locators each matching only one of the objects that the original locator matches. Specialized locators may use whatever attributes are necessary to pinpoint the exact object (automationIndex will be likely used). The function will return at most maxResultCount items (if specified, otherwise all matching items will be returned). |
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 Flex 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. |
lastConnectedApp |
lastConnectedApp() Returns most recently connected application information. The result is an object with 'id' property set. |
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.
See also Controlling browser opening and closing. |
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. |
registerTeardown |
registerTeardown(function,scope) Register a terdown function. The function will be called when execution of the script completes. Multiple shutdown functions can be registered in which case they will be called in the reverse order of registration. spcoe can be SC_THISSCRIPT or SC_ALLSCRIPTS. For SC_THISSCRIPT scope the registration applies to current script only. For SC_ALLSCRIPTS the registration remains active for duration of project and teardown function will be called after every script in the project. |
selectApp |
selectApp(appId) Select Flex 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. See setErrorMode usage article. |
setExecutionDelay |
setExecutionDelay(argument) Set a delay in milliseconds to wait after every action execution. Returns the previous delay value. Default value is 0. |
setImageSearchOpt |
setImageSearchOpt(option, value) Set image searching options. Currently supported option is SO_TOLERANCE. It specifies allowed difference between pixel RGB values. The value for tolerance should be an integer from 0 to 255. The tolerance of 0 requires exact matching of RGB values. The tolerance of 255 will match any two images The default value is 10. |
setLocatorOption |
setLocatorOption(option, value) Set locator resolving option. The options define how the locators behave before an action is executed or a property is accessed. Returns previous value of the option. The following options are supported:
|
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 |
unregisterTeardown |
unregisterTeardown(function,scope) Unregister a previously registered teardown function. |
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. |
verifyImage |
verifyImage(locator, image, options) Verify that an image is found relative to the object specified by locator. options specify the area to search and is one of the following: SO_EXACT (image must match object exactly), SO_INSIDE (image must be inside object's area, i.e. object fully contains the image), SO_LEFT (image must be on the left of object's area), SO_TOP (image must be on the top of object's area), SO_RIGHT (image must be on the right of object's area), SO_BOTTOM (image must be on the bottom of object's area). |
verifyMatch |
verifyMatch(argument1,argument2) Verify that argument1 matches argument2. If argument2 is RegExp pattern matching is performed. If argument2 is an Object it will be verified that specified properties exist on argument1 and they match specified values.If arguments are not primitive types (e.g. are objects or arrays) all sub-components are verified to be matches as well. Outputs verification passed or failed message to log. |