QTP Object Repository



QTP Object Repository

In QTP the object Repository are 2 types
·         Local Repository
·         Shared Repository

The above 2 types and the way object repositories created for the test is completely changed from QTP 9.0 onwards.

Earlier versions before 9.0,,, ie. 8.2, 8.0…..etc   for any test there was only 1 Repository either local or shared not both

But from 9.0 onwards for every action in a test has separate object repository (.bdb file) and also has shared Repository (.tsr) associated to that

Local Object Repository

Local Object Repository contains Test Objects in a .ddb file with each Action.  Each action will have its own local object repository.

These objects can be modified from the corresponding Action. (Resources menu
à Object Repository)

This local object repository can NOT be reused for any other action/or edited by any other Actions within the same Test.

There is separate ObjectRepository.bdb file created for each Action sub folder within the Test folder when we save the test.

The local object repository will be created automatically and the Test objects will be automatically stored in the Local repository while doing recording / added from the object repository in resources menu

Note : Default size of local repository is 192 KB but based on the objects added the size increases

Shared Object Repository

If same objects are required in multiple actions then instead of duplicating,, we can create a separate repository and it can be shared.

A shared object repository contains test objects in a file (.tsr ) that can be accessed by any number of actions in any Test ( the shared objects are read only in the repository).

We can create this Shared Object Repository manually from Object Repository Manager. In Resources menu.

We can also export the local object repository objects into the Shared Repository file.
(Go to Object RepositoryàFile menuàExport local objects)

Associating Repositories

Each Action can use the objects from local object repository and from multiple shared object repositories.

Association of Object repositories can be done easily from the "Associate Repositories" Dialog window which will be opened from Tools->Associate Repositories menu in the Object Repository window.

Note : 
a.       If same local objects exists in Local repository and same object associated from shared repository, the local object will be considered
b.      If multiple repositories are associated and if both repositories contain same object then the object from 1st shared repository is considered
c.       2 shared Repositories can be merged into single repository ( in OR Managerà tools menuà merge repositories)
d.      When 2 repositories are merged and in both repositories same object with diff properties then it is conflict

Comments