English|Deutsch
Subscribe Ranorex Announcements Feed Ranorex LinkedIn Ranorex twitter Ranorex Facebook Ranorex Google+

Repository Separation

By default each Ranorex Studio project contains one repository file which is automatically used for each newly created recording. You can manage all UI elements of a test suite project in a single repository file, but there are several reasons for having multiple repositories within a test automation project:

  • Testing Different User Interfaces
  • Common Repositories for Common Modules
  • Advanced RanoreXPath Repositories for Complex Identification
  • Multiple Testers Working on the Same Test Automation Project
Testing Different User Interfaces

If your test suite contains, for example test cases for a web application and tests for a user interface of a client application, it might be useful to have two repositories. One is used to manage the UI elements of the web application while the other one exclusivily stores the elements from the client hosted application. Although you can separate it within one repository using simple folders for grouping, it makes sense to split it especially when working in teams.

Common Repositories for Common Modules

The same way you think about modularization and reusability of small action recordings, the same goes for repositories. For example when you think about a rich client application using main menus, ribbons or toolbars you would create small reusable recordings like to click on the main menu 'File' | 'Open' | 'Handle the Open File Dialog' | etc. All these reusable modules working with a main menu, a main tool bar or similar common available controls, should be based on a repository which exclusively represents commonly used main controls on the user interface.

Advanced RanoreXPath Expressions

Another reason to build a separate repository could be to store advanced RanoreXPath expressions which should execlusively be used to create new actions manually instead of recording them.

Mulitple Testers on the Same Project

As long as you're working alone on a test automation project it's not a problem to work with one single repository. When working in teams and everyone in the team only clicks the 'Record' button to create test automation modules, it is recommended to keep in mind who is responsible for the main repository. Who is allowed to rename objects and to re-structure the repository? The main reason to separate repositories is to avoid accidental damage of repository items which are used by other team members.

Adding a New Repository

Add a new repository to your project by clicking the 'Add Repository' button in the Ranorex Studio toolbar. 
Create a new repository file
Create a new repository file
Repository representing user interface of Ranorex download page
Repository representing user interface of Ranorex download page

Using Repository in Recording

Now create a new recording file and switch from the default repository to the repository which contains the web elements.

Use the web repository instead of the default repository
Use the web repository instead of the default repository
Manually created actions table used to fill in the download form at ranorex.com
Manually created actions table used to fill in the download form at Ranorex.com

Using Mulitple Repositories in Code Modules

Now your test project contains two repository files. While a recording module can only have one repository assigned, a code module can use multiple repositories:

C#

[TestModule("41F66FF2-66D3-42F5-8EC1-F577F8D2D6BC")]
public class CodeModule: ITestModule
{
    // Repository object to access UI elements of VIP Database
    MyFirstTestProjectRepository repo = MyFirstTestProjectRepository.Instance;
    // Repository object to access UI elements of Ranorex web page
    WebRepository webRepo = WebRepository.Instance;	
       
    void ITestModule.Run()
    {
        Mouse.DefaultMoveTime = 300;
        Keyboard.DefaultKeyPressTime = 100;
        Delay.SpeedFactor = 1.0;
            
        // Set text value in VIP appliction
        repo.MyApp.FirstName.TextValue = "John";
        // Set text value in Ranorex.com download form
        webRepo.Ranorex_Com.InputForm.FirstName.Value = "John";              
    }
}
Note: Even though it's possible to use multiple repositories within a code module you should not ...