Lesson 1 - Getting Started
If you'd like to find out more about GUI testing, feel free to also read through the respective chapter in our testing wiki.
Preparing to Record User Actions
Before you start recording you need to ensure that your system under test (SUT) is ready to start with the manual test execution. In addition, consider the following points in order to avoid too much work in cleaning up the recording and the repository afterwards.
- Do not run multiple instances of your application under test if that is not part of the test case itself.
- By default mouse movements are not recorded. For this reason please also perform a mouse click in situations like when navigating through menus.
Open source tool KeePass
Since version 3.3, KeePass is included with Ranorex Studio along with a sample database file.
On the start screen of Ranorex Studio you'll find a 'Sample' button which also includes a sample test suite project that handles some test cases within the KeePass application. You can have a closer look at that in Lesson 4: Ranorex Test Suite - General Structure of a Test Suite and its Test Case.
Recording a Test
In the following section you will create a new Ranorex Test Solution and record the process for adding an entry to KeePass.
Start Ranorex Studio and open the empty recording file.
Open Ranorex Studio by choosing Start>Programs>Ranorex>Ranorex Studio. Click the 'New Test Solution...' button to create a blank test suite project.
Ranorex Studio Start Page - creating a new test solution
In the categories box select C# and in the templates box select the Ranorex C# Test Suite item. Next specify a name and a location for your new test suite project.
Click the 'Create' button and a new test suite project opens.
Specify programming language and project name
New Ranorex Test Suite containing one test case using an empty recording
Start recording a test for the KeePass application.
You can open the project folder by right-clicking the project in the 'Projects' view and choosing 'Open Folder in Explorer' from the context menu
Open project folder in explorer to copy the sample application to the project folder
Click the 'Record' button in order to start. The Recorder assists you in preparing the application under test. Choose 'Desktop' as technology and click on 'Add app' to add KeePass to the list of applications under test.
Recording actions for the KeePass application
Enter the default Password.
Click on the text field next to the 'Master Password' check box
Type in the default password ('rx')
KeePass Login Dialog
Open the 'Add new Entry' Form.
- Click on 'Edit' in the main tool bar
- Click on the 'Add Entry' menu item
KeePass application with sub menu 'Edit' (Menu item 'Add Entry' is selected)
Add a new entry to the KeePass application.
- Click on the 'Title' text box and type in 'WordPressDemo'
- Click on the icon button (with the key symbol)
- Choose any icon (e.g. the second one)
- Click on 'Close'
- Click on the 'User name' text box and type in 'admin'
- Click on the 'Password' text box
- Click again with the right mouse button
- Choose 'Select All'
- Type in 'demo123'
- Repeat the same for 'Repeat' text box
- Click on the 'URL' text box and type in http://bitly.com/wp_demo
- Click the 'Expires' button on the right (watch symbol)
- Choose '1 Year' menu item
Click on 'OK' button
KeePass form for adding a password entry
KeePass form for choosing an icon
KeePass expiration sub menu
Validate the result
After adding a new password entry, a new row is added to the KeePass grid holding the recently entered item. Click the 'Validate' button within the 'Recording' toolbar to check whether the entry appears in the grid. Move the mouse pointer to the grid (i.e. the first cell) and wait a moment until the underlying UI element is highlighted.
KeePass form with highlighting frame for validation
Choose UI element to validate
Choose attribute to validate
Delete added item and close application.
In order to finish the recording scenario select the added item within the data grid and delete it from the list by pressing the 'DEL' button on your keyboard.
Finally press the save button in the toolbar and close the application by clicking the close button.
Screenshot indicating the save button in the tool bar
Analyzing Recorded Steps
Recorded steps shown within the actions table
Executing the Test
In order to execute the recorded test you need to switch back to the Ranorex Test Suite file. Just click on 'Run' to execute the test suite with your first recorded test.
During the execution Ranorex simulates all user actions (mouse movements and keyboard events) in order to test the application in the same way a tester would successfully do it.
Start the test by clicking the 'Run' button
After executing the test, Ranorex Studio automatically opens the generated test report file (*.rxlog) which shows whether the test run was successfully or not.
Test run succeeded
Test run failed
Force an error by changing the expected value of the validation step
Now the test automation executable is also available within your project folder. To run the test suite without starting Ranorex Studio, simply double-click the executable file.
'MyFirstTestProject.exe' located within the build folder of the project
By default the report files are also generated within the same directory. Further information on changing the report folder can be found in Lesson 4: Ranorex Test Suite - Test Suite Settings.
Read more about alternative ways to run the test suite from the command line or with the standalone test suite runner in Lesson 4: Ranorex Test Suite - Running Tests without Ranorex Studio.