Associating a Shared Object Repository to the Current Test in QTP 9.2

Once a shared object repository is created i.e the .tsr file it has to be associated to the current test other wise the objects cannot be identified and hence your script do not work because for your current script there won’t be any object repository associated. Shared Object repository is where you store your information in a central place and different users can access the repository. It is to be noted that by default the shared object repository will be in read only mode.


In order to associate the shared object repository we need to perform the following steps.

Step 1: Navigate to Resources > Associate Repositories. The "Associate Repositories" window will be opened.



Step 2: In the "Associate Repositories" window Click the "+" button which is in green color. The Add Shared Object Repository Widow Opens. Here you can select the path of the .tsr file and click Open Button.



Step 3: In the "Associate Repositories" window under the "Repositories" frame you will be seeing the path of the .tsr file highlighted and also in the "Available Actions" frame you will see "Action 1" displayed.


Step 4: Now select the "Action 1" and click the right arrow button. The "Action 1" will be shifted to "Associated Actions" frame and click "OK" button. This means that the shared object repository is now associated to the current test.


Step 5: Now open the Object repository by navigating to Resources > Object repository or Press "Ctrl + R". The "Object repository > All Object repositories" window will be opened and you can see the objects listed in the window under Action 1.

Note: When you use a shared object repository in your current test as associated repository the objects and the properties are read only which means you cannot change the object & properties names, values.


If you add any objects from the application under test to this repository then they will not be added into the shared object repository but will be added in the local object repository and you can manage them but if you try to export the objects it will create a new shared object repository and only the object added locally will be stored in the new .tsr file.


Look in the image and the highlighted object and properties. The object identification for this object during run time happens for this current test and you cannot save this object into the shared repository you have associated. Even if you export it will create a new .tsr file and only the object added currently will be saved.

Assignment: Create a shared object repository and associate it to the current test. Now learn an object from the Application and try to export the object repository and see what happens.

4 comments:

Ajay said...

What if we need to do the same for many scripts?

Anonymous said...

I want to associate my test with the object repository stored at shared network location.Please guide me how to store that OR at n/w and then how to associate that???

Anonymous said...

beans on toast

BiLi said...

how to use "shared object repository" for external action? thanks

Post a Comment

/* Tynt Insight tracker ----------------------------------------------- */