The easiest way to create a first test with Ranorex is to record a manually executed test scenario. The recorded actions like mouse clicks or keyboard actions are the base for building a robust test case. In this lesson you will learn about:
Screencast: The screencast "Quick Start with Ranorex Test Automation" gives a short introduction to the Ranorex Recorder. You can jump directly to the noted position in the video by clicking http://youtu.be/0S_YC7uwI-s#t=1m8s.
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.
Note: Read more about how to activate mouse movement recording in Lesson 5: Ranorex Recorder - Recorder Hotkeys.
System Under Test: KeePass Password Safe
Since version 3.3, KeePass is included with Ranorex Studio along with a sample database file.
Note: The password to open this database file is 'rx'.
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.
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.
Note: Because of possible performance and security impacts, projects should not reside on a network drive (neither should Ranorex itself be installed on a network drive). It's recommended to use a version control system (VCS) instead.
Click the 'Create' button and a new test suite project opens.
Start recording a test for the KeePass application.
Note: It's recommended to copy the KeePass application folder from the sample directory within the Ranorex installation folder (<Ranorex Installation Folder>\Samples\Desktop\KeePass Sample\KeePassTestSuite\KeePass) to your projects folder as by default you do not have write access to the program folder which is necessary to save the database handled by KeePass.
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
Note: You will notice that a red border will be shown when moving the mouse over a UI element indicating which element is taken for automation. The red border will assist you during the recording process. You can en-/disable this feature in the Recorder Settings Dialog.
Enter the default Password.
- Click on the text field next to the 'Master Password' check box
- Type in the default password ('rx')
Open the 'Add new Entry' Form.
- Click on 'Edit' in the main tool bar
- Click on the 'Add Entry' menu item
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
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.
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.
Analyzing Recorded Steps
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.
After executing the test, Ranorex Studio automatically opens the generated test report file (*.rxlog) which shows whether the test run was successfully or not.
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.
Note: In order to run the test suite project on an external machine it is required to have the executable (*.EXE) as well as the test suite file (*.RXTST) in the same directory at the target machine. If your Ranorex Studio solution consists of more than one project, you need to ensure that the library (*.DLL) files are also part of the same directory. In short, it is best to copy the complete output folder (e.g. 'bin/debug') to the target machine.
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.
- Ranorex Studio - The Layout
- Lesson 1: Getting Started
- Lesson 2: Ranorex Modules - Test Actions
- Lesson 3: Data-Driven Testing
- Lesson 4: Ranorex Test Suite
- Lesson 5: Ranorex Recorder
- Lesson 6: UI Mapping with Ranorex Repository
- Lesson 7: Code Modules
- Lesson 8: Reporting
- Lesson 9: Ranorex Spy
- Ranorex Settings
- Ranorex Remote
- User Code Library
- Selenium WebDriver integration
- Code Examples
- Data Connectors
- Instrumentation Wizard
- Technology Instrumentation
- RanoreXPath Weight Rule Library
- Ranorex UI Adapter
- Mobile Testing
- Android Testing
- iOS Testing
- Web Testing
- Source Control
- Ranorex Studio IDE
- Visual Studio Integration
- System Requirements
- 64-bit Platforms
- Remotely Working with Ranorex
- Silent Installation of Ranorex
- XCOPY Deployment
- How to instructions