| Cogitek RIATest 3 Documentation | Copyright © Cogitek Inc. |
Recording is very useful for quick creation of test scripts. However sometimes you will want to perform more sophisticated actions such as repeating a sequence of user interface actions many times or performing conditional execution of actions depending on the state of your application.
RIATest tool uses RIAScript - a language similar to ActionScript for writing test scripts. Basic language elements in RIAScript are almost exactly the same as in ActionScript. You can declare and assign values to variables, make function calls, write conditional and loop statements. See the RIAScript Reference Guide for a detailed description of the RIAScript language syntax.
Test scripts are usually sequence of actions and checkpoints. Actions specify what to do with application GUI components. Checkpoints verify that properties of GUI components have expected values. See for example the following test script snippet:
FlexColorPicker("colorPicker")=>open();
FlexColorPicker("colorPicker")=>change("#00ff00");
verifyEqual(FlexColorPicker("colorPicker")=>selectedColor,"#00ff00");
Lines 1 and 2 in the above generate open and change actions on a Flex ColorPicker component that has automationValue 'colorPicker' (automationValue in this case matches the id of the component). Line 4 is a checkpoint that verifies that selectedColor property of ColorPicker is actually set to the expected color.
For the complete list of classes, possible events and properties see Flex Automation Classes Reference Guide.