RIATest Documentation Copyright © RIATest.com

Writing test scripts manually

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 multiple 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 RIAScript Reference Guide for detailed description of 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 above generate open and change actions on a Flex ColorPicker component that has automationValue 'colorPicker' (automationValue in this case matches id of the component). Line 4 is a checkpoint that verifies that selectedColor property of ColorPicker is actually set to expected color.

FlexColorPicker above is the name of the Flex component class to perform action on. open and change are names of actions (also known as events) to generate. selectedColor is the name of the property of ColorPicker. For the complete list of classes, possible events and properties see Flex Automation Classes Reference Guide.