Home FAQs Features and Functionality

Features and Functionality FAQs

Feel free to contact us if you do not find an answer to your question below.

What operating systems does RIATest run on?
Do I need to compile with RIATestAgent3.swc or RIATestAgent4.swc?
I am using the 3.0 Beta version. Will I have to recompile my application after downloading RIATest 3.0 Final?
Does RIATest support Flex 2 applications?
Does RIATest support applications written with Flex 3 or Flex 4?
Does RIATest work with AIR applications?
How similar is RIATest scripting language to ActionScript?
I get "Agent Build number mismatch (IDE=N, Agent=M). Recompile application." message.
How to do parametrization and data-driven testing?
How can I use command line execution to run my test scripts?
RIATest waits for a few seconds for the agent to connect. Can I increase the wait time?
How can I get the Application ID?
I would like to know if there is a way of recording actions on objects based on their IDs?
We derived a custom component from HBox and it is not recognized by RIATest.
I get a "No scripts in the project to run" message
Does RIATest support custom components?
Is there a way to have the browser reload after running a test script so that the next test can start with the application in a clean state?
Does RIATest support commands like verifyNot, for example verifyNotEqual?
Can I query SQL databases from RIATest?

What operating systems does RIATest run on?

Microsoft Windows 2000, XP, Vista, Server or Mac OS X.


Do I need to compile with RIATestAgent3.swc or RIATestAgent4.swc?

Compile Flex 2 applications with RIATestAgent2.swc only, Flex 3 applications with RIATestAgent3.swc only and Flex 4 applications with RIATestAgent4.swc only.


I am using the 3.0 Beta version. Will I have to recompile my application after downloading RIATest 3.0 Final?

Yes, you will need to download the full release and recompile your application if you are using the static compilation option.


Does RIATest support Flex 2 applications?

RIATest versions 1.5 and higher support Flex 2.
Runtime Loader option is not supported for Flex 2 applications, only the static compilation option is supported.


Does RIATest support applications written with Flex 3 or Flex 4?

Yes, RIATest supports Flex 2, Flex 3 and Flex 4 applications. For Flex 4 Spark components support is limited to the following components: Application, Button, CheckBox, Panel, Radio Button, ScrollBar, TextArea, Text Input, VGroup, HGroup, RichEditableText, Slider, NumericStepper.


Does RIATest work with AIR applications?

Yes, RIATest works with AIR applications.

1. Compile your AIR application with RIATestAgentN.swc and Flex automation libraries. See section "Embedding RIATest Agent at compile time" in Getting Started document.

2. In Project|Options select "Without browser, standalone exe or AIR application" and type the AIR application exe file path in the Application URL box, e.g. C:\Program Files\TestAIR\TestAIR.exe
The AIR application must be previously compiled in Flex and installed on your computer.

RIATest 3.0 and newer supports AIR applications that have multiple windows.


How similar is RIATest scripting language to ActionScript?

Both ActionScript and RIAScript are based on the ECMAScript standard. RIAScript is a subset of ActionScript with very few enhancements (such as the waitfor operator). Formally RIAScript and ActionScript are not the same language but they are as close as it gets.


I get "Agent Build number mismatch (IDE=N, Agent=M). Recompile application." message.

Your application is compiled with an older version of Agent. Recompile your application with RIATestAgent.swc file that comes with RIATest installation package. If you have recompiled your application but are still getting this error message try clearing your browser cache, it is most likely that your browser is serving an older version of your application

With a properly compiled application you should not get this message. This only happens if you use RIATestAgent.swc with a version not matching the RIATest IDE version.

You may also get this if you are using RIATest Runtime Loader using Remote Loading scheme and you forget to update the new Loader on your server.


How to do parametrization and data-driven testing?

Please see parametrization documentation.


How can I use command line execution to run my test scripts?

Use the following:
riatest.exe /b /r /p c:\mypojectdir\myproject.rtp
It will execute and return exit code 0 on success or other exit codes on failure.

You can also use environment variable RIATEST3:
"%RIATEST3\riatest.exe" /b /r /p c:\mypojectdir\myproject.rtp

RIATEST3 variable points to the installation directory not to riatest.exe.
This is done on purpose so that you can also refer to other files such as
"%RIATEST3%\agent\RIATestAgent3.swc" in the build tool.


RIATest waits for a few seconds for the agent to connect. Can I increase the wait time?

RIATest by default waits for 60 seconds for the agent to connect after starting the script execution. If 60 seconds are not enough you can disable the "Wait for Agent before running" project option and perform waiting actions from within your first running script by adding the following lines at the top of the script:

setWaitTimeout(100000);
waitfor(isAppConnected("App"));
The first line sets the timeout for the waitfor operation to 100 seconds (default is 30 secs). The second line waits until the agent is connected to RIATest. You need to pass to the isAppConnected function the id of your application.


How can I get the Application ID?

You can look in the html file that loads your swf file. If you are using the standard Flex html wrapper you need to find the call to function AC_FL_RunContent and see what is passed for "id" parameter. This is usually the same as the name of your main mxml file of your Flex application.

You can also launch your application from RIATest. When the agent connects you should see something like this in the message log: Agent connection accepted. Application id=App


I would like to know if there is a way of recording actions on objects based on their IDs?

For example, I have an action

FlexButton("My Button Text")=>click();
Where "My Button Text" is the Label on the Button. If this label changes (for example during localization) it will throw off the test scripts created based on them. Instead if it were using the underlying ID, which does not change that often, the test scripts can be mostly stable.

RIATest uses automationName for identifying components. Each Flex component uses one of its properties as the default value for automationName.
For example Button uses its label for automationName.
However you can set automationName to something else in your application and it will be picked by RIATest and used for recording/playing. For example:
<mx:Button label="My Button Text" automationName="myBtn"/>

For the above Button RIATest will generate FlexButton("myBtn") locator. This is how it is supposed to work according to the Flex automation framework and this is what RIATest currently uses.

You can also access objects using their IDs. For more details see this article.


We derived a custom component from HBox and it is not recognized by RIATest.

HBox is specifically excluded from the automation hierarchy by setting showInAutomationHierarchy to false (since it is not a interactive component, and is only used for layout).
If your component is an interactive component and you will want it to be visible to automation you simply need to add one line in the constructor of your component:

public function MyComponent()
{
    super();
    showInAutomationHierarchy = true;
}


I get a "No scripts in the project to run" message

There must be at least one script in the project to run.

Right click on the project item on the 'Project' pane and select 'Add Existing Script' then navigate to your script file and add it to the project.

You should be able to run the project now. Note that only scripts added to the project are being executed when the 'Run' command is selected. Make sure that you save the scripts before running.


Does RIATest support custom components?

Yes, RIATest supports custom components. For more details see this article.


Is there a way to have the browser reload after running a test script so that the next test can start with the application in a clean state?

It is possible by manually controlling the browser entirely from the script instead of relying on RIATest's built-in browser management.

You will have to first tell RIATest not to try to open a browser by turning off the "Launch application" project option and also turn off the "Wait for agent before running" option. Then turn on "Allow multiple agent connections". This combination of 3 options will effectively disable any browser management that RIATest does. Once you have disabled the built-in browser control you have two options:

1. Use openBrowser/closeBrowser functions to control the browser. For example:

// This will open specified App.html file in Internet Explorer 
openBrowser("../Components/app/bin/App.html",BR_IE); 

// Wait for the application to load and connect
waitfor(isAppConnected("App")); 

// Close previously open browser
closeBrowser(); 
See also BrowserControl sample project that comes with RIATest installation.

2. You can open the browser using Process class and wait for your application to connect, for example like this:

var browserProc = new Process("cmd.exe /c start /wait iexplore "+
  "\"C:/ProgramFiles/RIATest/samples/Components/app/bin/App.html\"");
waitfor(isAppConnected("App")); // Use correct id instead of App here. 

Note that as soon as the script ends the browser will be terminated since it is tied to the instance of Process stored in a script-local 'browserProc' variable.

If you want the browser to stay open across several scripts then store the instance of browser Process class in a project-wide global storage using setProjectGlobal, e.g.:

setProjectGlobal("ourBrowser",browserProc);

Then in any other script you can do the following:

var browserProc = getProjectGlobal("ourBrowser"); 
browserProc.kill(); 

This will close the browser. You can then open another one the same way as you opened the first one.


Does RIATest support commands like verifyNot, for example, verifyNotEqual?

You can negate any condition using the ! operator.

For example to verify that a button is not present you can do the following:

verify(!isPresent(FlexButton("myButton")));

To verify that the value of a property is not equal to some other value use the operator !=

For example:

verify(FlexButton("myButton")=>fontSize != 10);

Can I query SQL databases from RIATest?

RIATest has no built-in support for database querying. A third-party project to allow database access from RIATest scripts has been produced by Maxim Porges. For more details see riatest-integrator project. Make sure you read this post from the author.
 

Feature Poll

Vote for new RIATest feature: