| Cogitek RIATest 3 Documentation | Copyright © Cogitek Inc. |
RIAScript support the standard set of arithmetic, logical, relational and conditional operators. In addition to the standard operators RIAScript defines 3 special operators: locator compose ->, locator execution => and waitfor operators.
| Operator | Name | Associativity |
|---|---|---|
. [] |
Member selection Array access |
left to right |
-> |
Locator compose |
left to right |
| => | Locator execution | left to right |
++ -- |
Postfix increment Postfix decrement |
left to right |
waitfor typeof ++ -- + - ~ ! |
waitfor condition typeof expression Prefix increment Prefix decrement Unary plus Unary minus Bitwise complement Logical negation |
rght to left |
* / |
Multiplication Division |
left to right |
+ - |
Addition Subtraction |
left to right |
> < >= <= == != |
Comparison greater-than Comparison less-than Comparison greater-than-or-equal Comparison less-than-or-equal Comparison equal Comparison not equal |
left to right |
| & | Bitwise AND | left to right |
| ^ | Bitwise XOR | left to right |
| | | Bitwise OR | left to right |
| && | Logical AND | left to right |
| || | Logical OR | left to right |
| ?: | Ternary condition | right to left |
| = | Assignment | right to left |
Locator compose operator -> is used for composing multipart locators, e.g.:
FlexApplication("myapp")->FlexButton("login");The above code defines a locator that will match a button which is placed directly within the application.
Locator execution operator => is used for executing component actions and accessing component properties, e.g.:
FlexButton("login")=>click(); verifyEqual(FlexButton("login")=>enabled, true);The above code will execute a click action on a button and then will verify that the value of the enabled property is true.
Operator => has a lower precedence than operator -> thus the following code is valid:
FlexApplication("myapp")->FlexButton("login")=>click();
The waitfor oeprator has the following syntax:
waitfor(condition);the waitfor operator will evaluate the condition continuously until it becomes true or until timeout. The timeout by default is 30 seconds and can be changed using the setTimeout global function. The result of the waitfor expression is true if condition was or became true and false if wait is timed out.