| Cogitek RIATest 3 Documentation | Copyright © Cogitek Inc. |
Every piece of data in RIAScript belongs to one of the following types: Number, String, Array, Object, Locator.
var arr = [1,3,5]; // creates an array consisting three elements var x = arr[0]; // gets first element from array and assigns to x
var obj = {x:10, y: 20};
trace(obj.x); // prints 10 in the message log
var myButton = FlexButton("Login"); myButton=>click(); // performs 'click' on the button< trace(myButton=>label); // prints 'Login' in message logThe above expression creates a locator for Button that has text 'Login' and performs a 'click' action on the button. Notice how the => execution operator is used for calling actions and getting properties values.
Locators can also reference multiple components in the hierarchy of your application components. This may be required to uniquely identify a component. For example suppose you have multiple panels in your application and buttons named 'Close', one in each visible panel. You can use the following locator to click on the desired button:var aButton = FlexPanel("Authors")->FlexButton("Close"); aButton=>click();This code snippet will locate the 'Close' button in the 'Authors' panel and will click it. Parts in a multipart locator are separated by the locator compose -> operator. Note that if necessary RIATest will correctly generate multipart locators during recording.
There are also several utility types which are derived from Object. See references: CSVStream, Date, FileStream, Math, Process, RegExp, UIDUtil.