Adapting an Existing Repository
File view of a repository
Integrated repository view within the Recorder
Screencast Watch the screencast (http://youtu.be/uYqruaEUcCU) on organizing and optimizing a Ranorex Repository to find out how to best use simple and rooted folders.
You can access and edit the repository (directly) in the recorder view by double clicking the file ('MyFirstTestProjectRepository.rxrep') in the projects view as shown in the figures above.
Renaming Repository Items
Each UI element within the repository can have a logical user-defined name. The more logical names you use the easier it is to understand test automation code and report files. In order to rename an item in the repository, first select it and then click the item to enter edit mode. Optionally you can use the keyboard shortcut <F2> to edit the names.
Renaming of repository items
Creating Logical Folders
The more objects you have in a repository the more structured and organized it should be. For this reason you can structure and group UI elements which logically belong together. Add a new 'Simple Folder' using the drop-down button in the repository toolbar.
Adding a 'Simple Folder' to the repository
Repository using two logical folders to group input fields and buttons
Repository Structure - Types of Elements
A repository can have the following types of items:
|Application Folder #1||Represents a top level application, a dialog or a context menu|
|Rooted Folder #2||Contains GUI elements having the same parent (i.e. RanoreXPath prefix)|
Simple Folder #3
|Used to group items|
|Adapter Item #4||
Represents a Ranorex adapter (Button, ListItem, TextBox, ComboBox, etc.)
Use the 'Add New Item' button in the toolbar to add new items manually.
Searching For Elements
Specify whether to search in 'Names', 'Paths' or to 'Search All' elements
Search result for text 'button' used in names and paths
The repository's 'Cleanup' button is used to search for currently unused items and to delete these items afterwards. Unused items mean they are neither used by recording modules nor by code modules.
Considering the situation that a user clicked unintentionally on some desktop icons during the recording, these icons would have been added to the repository as well. Cleaning up would be beneficial in that case.
Another situation where cleaning up is helpful is when UI elements which are still linked from the repository are no longer part of the software under test.
In order to keep your repositories as tidy as possible, use the 'Cleanup' functionality from time to time to avoid disorder.
The 'Cleanup' button
Note The cleanup functionality only searches for used items in the solution the repository is located in. There is no check if items are used in other solutions referencing the repository.
Find Repository References
In Lesson 7: Code Modules you will learn about how to use repository items in code modules. Before you modify an existing repository item (e.g. the item's name or the item's RanoreXPath), it might be necessary to check which code files use that item. Use the context menu item 'Find All Code References' to list all code files using a certain repository item. You can choose whether to search in all the code files or only in the user code files.
Search for references of repository item KeePass
Search result - simply double-click a result item to open the code file
Search for references of a repository item in all test modules