Getting Started with Windows application testing
This document will help you get up and running with RIATest, a powerful test automation tool for Windows Desktop and Windows 8 Store (aka 'Metro') applications.
Before you begin
System RequirementsIn order to use RIATest to automate testing of your Web application you need:
- Microsoft Windows XP SP2, Vista, Server or Windows 7 or 8
- Windows UI Automation API 3.0
Creating a RIATest project
First create a RIATest project.
- Run RIATest IDE and select File, New Project.
"New Project" window appears:
- Select project type "Windows application testing", specify a project name and a folder to store the project:
- In Application EXE specify the location of your application executable file.
- Click OK to close the window and create the project.
- Select Run, Launch Application.
Your application will be launched. The RIATest IDE title bar displays "Launched".
- Switch back to RIATest IDE and verify that the message log shows the following lines:
Launching "C:\Program Files (x86)\calc.exe"
Application launched (process id=2684).
To record a script
- In RIATest IDE, select Project, Add New Script. Enter a name and click Save.
- Select Run, Start Recording.
RIATest IDE title now show "Recording".
- In your application window, perform the test actions. If required, generate
checkpoints (see below).
The RIATest IDE records actions as statements in the Test Script window.
- To stop recording, select Run, Stop Recording.
While recording a script, you can generate checkpoints. A checkpoint stores the values of the selected component. During playback, RIATest IDE compares the current values with those stored in the checkpoint and reports accordingly (see below).
You can hand-code checkpoints, but it is simpler to generate them during the recording process.
To generate a checkpoint based on a selection of the component's properties
- In RIATest Object Inspector window, click Inspect then hover the mouse over a component.
A blue frame highlights the component. Its class, name and all available properties are displayed.
- Click on your chosen component.
- In RIATest Object Inspector window, click Verify button and select Verifty Properties menu item.
The selected component's properties are displayed:
- Use the checkboxes to include properties in the checkpoint.
- Click OK.
The resulting checkpoint stores the values of the selected properties, only.
Editing your recording
You can stop and restart a recording at any time. This enables you to correct any mistakes.
To delete mistakes
- If you have not already done so, in RIATest IDE, select Run, Stop Recording to stop the recording.
- Select the unwanted actions and delete them.
- Select Run, Start Recording.
Inspecting the components
RIATest provides an easy way to browse GUI elements during recording.
- In RIATest IDE, click Inspect button in the Object Inspector window then hover the mouse over
a component in your application window.
A green frame highlights the component
- Click anywhere to exit "inspect mode". The Object Inspector will show the selected component in the tree and all available properties
of the component will be displayed:
Playing back test scripts
When you play back a test script, the Message Log reports the results.
- Successfully passed checkpoints generate green messages.
- Failed actions and checkpoints generate red messages.
The Message Log also shows the number of scripts that ran without any errors, and the number of scripts that encountered problems.
To run a test script
- In RIATest IDE, select File, Open Project and select your project.
- Select Run, Run Without Debugging.
Your application launches. RIATest IDE replays the recorded actions and checkpoints, recording the results in the Message Log.
After playback finishes, your application terminates.
If you encounter unexpected errors during playback, you can debug your scripts.
To start a debugging session
- In RIATest IDE, select Run, Run Tests.
Scripts run as usual. If any problems are encountered (such as checkpoint or action failure), the script suspends with the problem line highlighted.
- Do one or more of the following:
- Inspect the most recent message in Message Log. This usually explains the problem (e.g. Expected vs. Actual values will be shown for a failed checkpoint).
- Hover the mouse over variable names to examine their values.
- Switch to your application and inspect components and their properties.
Writing test scripts manually
Sometimes you will need to perform sophisticated tests such as repeating the same sequence of user actions, or conditionally executing actions depending on the state of your application. For these, recording a script is not suitable - you need to write one manually.