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:
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.
Now create a new recording file and switch from the default repository to the repository which contains the web elements.
[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";
}
}
Online User Guide
download as: PDF (20.3MB)
Ranorex Tutorial
(PDF file, 13.5MB)