| RIATest 2 Documentation | Copyright © RIATest.com |
Locator is used for referencing application components:
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 => execution operator is used for calling actions and getting properties values.
Locators can also reference multiple components in the hierarchy of your application componenets. 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 locator compose -> operator. Note that if necessary RIATest will correctly generate multipart locators during recording.