By default, a Ranorex Studio project contains a single repository file that is used automatically for each new recording module. In many projects, managing all repository items in a single repository is sufficient. However, as your test suite grows, there are good reasons to work with multiple repositories in one project.
Reasons for multiple repositories
Working with multiple repositories can make your test suite easier to maintain, collaborate on, and scale.
Testing different user interfaces
If your test suite covers more than one application or UI technology (for example, a web application and a desktop client), it is often helpful to separate their UI elements into different repositories.
- One repository contains the items for the web application.
- Another repository contains the items for the client application.
You can also separate these elements using folders within a single repository, but using multiple repositories is usually more convenient, especially when several testers work on the same project.
Modularizing repositories
It is a good idea to modularize repositories in a way that mirrors your recording and code modules.
For example, in a rich client application with main menus, ribbons, or toolbars, you might create small reusable modules that handle actions such as File > Open or common dialogs like Open file.
These modules all interact with shared controls (main menu, toolbar, common dialogs), so it is useful to base them on a dedicated repository that represents only these shared controls. This makes it easier to reuse and maintain these elements across the test suite.
Multiple testers on the same project
When you work alone on a project, a single repository is often sufficient. In team projects, however, using only one repository can lead to frequent conflicts in source control.
Using multiple repositories helps reduce these conflicts. In addition, define clear rules and responsibilities, such as:
- Who may rename repository items
- Who may restructure repositories
- Who may delete or move items
Clear ownership and multiple repositories make collaboration more predictable and safer
Complexity and performance
Some test suites contain thousands of repository items. Keeping all of them in a single repository makes the structure difficult to understand and maintain and also increases the size of the repository file.
As your tests grow, consider how you can split repository items into multiple repositories (for example, by application, feature area, or shared controls) to keep them maintainable and performant.
Add a new repository
- In the Studio toolbar, click Add repository.
- Confirm that the Repository template is selected.
- Enter a name for the repository.
- Click Create.
Result
The new and empty repository is added and can be seen in the projects view.
- Newly added repository file with code representation and image hosting file
- Default repository
Assign a repository to a module
Once your project contains more than one repository, you can assign a specific repository to each recording module. The module then uses the repository items from that repository.
View the currently assigned repository
When you open a recording module, the currently assigned repository is shown in the repository toolbar. This allows you to quickly see which repository the module is using before you add or edit actions.
- The recording module
Recording1.rxrec - The repository
IntroductionRepositoryassigned to it
Assigning a different repository
Use this procedure to assign a different repository to a recording module.
- In the repository toolbar, click the currently assigned repository
- In the drop-down menu, click the repository you want to assign
- The currently assigned repository. In this case, it’s the default repository
- The other available repository, DatabaseTesting
- If your recording module contains actions that are linked to repository items from the currently assigned repository, you can choose to have Ranorex transfer these repository items to the newly assigned repository