This lesson will show you the benefits of splitting your recordings into smaller pieces (to provide for reusability) and how your projects can be easily assembled afterwards using drag and drop functionality in Ranorex Studio.
Refactoring: Why you should Separate Recordings
The ease of recording user actions encourages one to record all test cases without thinking about reusability. But in the long run, this could increase the effort in test automation maintenance. For this reason you should separate a recording into smaller reusable recording modules as suggested by the keyword driven methodology. In the following section you will learn how to separate existing recordings into smaller pieces to be reused by other test cases.
Screencast: The screencast "Ranorex Modules – Test Automation Actions" provides a short introduction to preparing recorded actions for reusability by extracting reusable Ranorex Modules. This screencast can be found at http://youtu.be/GrrKnf8cQ2g
Identifying ModulesIn your first recording, you did the following from a keyword driven perspective:
- Started the application KeePass
- Logged in
- Added a new entry
- Set the attributes for title, username, password, URL
- Chose an icon
- Set the expiration value
- Validated the existence of the newly created entry in the grid
- Deleted the entry
- Saved the changes
- Closed the application
In order to split recordings into smaller automation modules, select related actions and use the context menu item 'Move to new Recording Module'. Within the underlying recording, the three actions performing the log-in should be selected and moved into a new recording named 'LogIn'. These three actions are a click on the password field, a key sequence on the password field and finally a mouse click on the OK button.
Then, select and move all items used to add a new entry to the database to a new recording named 'AddEntry.rxrec'.
Repeat the previous steps to create modules for 'ValidateEntry', 'DeleteEntry', 'SaveDB' and for 'CloseSUT'.
Also rename the initial recording file (with only one recorded item left for starting the application) from 'Recording1.rxrec' to 'StartSUT.rxrec'. In the end you should have seven separate new recording modules.
After splitting the initial recording into smaller test actions, the Ranorex Module Browser also contains the new modules. Now simply use the drag and drop feature to combine these modules within the test case.
When having a huge amount of different modules you can use the search functionality of the Ranorex Module Browser which searches through the module name as well as the modules XmlDoc Summary. The XmlDoc Summary can be set in the properties of the module. You can open the properties by right-clicking a module in the Ranorex Module Browser and choosing 'Properties' in the context menu.
Note: When you are going to use the XmlDoc Summary, be sure to enable XML documentation creation in your project settings. In Ranorex Studio this setting can be found in the 'Compiling' tab in the project properties.
- 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