QTP Object Repository

By | May 25, 2009

Object repository in QTP:

Object repository is the heart of QTP, if you don’t understand it properly than you will face lots of problems in developing and testing of your application.

Please keep in mind following points regarding object repository:

– Test objects can be saved in two types of object repository
Local object repository and Shared object repository

– A local object repository stores objects in a file that is associated with one specific action, so that only that action can access the stored objects

– A shared object repository stores test objects in a file that can be accessed by multiple tests.

– When you want to create test (New project) you have two ways to store the objects in your test.

– Store the objects in corresponding local object repository OR
– Store the objects in one or more Shared object repository. (Smart ,advanced and efficient way) because it reduces maintenance and enhance reusability of your tests.

Object repository concept:

– In testing the most efficient way to save objects is in shared object repository.
– You can use the same shared object repository for multiple actions, if the actions include the same object.
– If an object with the same name is located in both the local object repository and in a shared object repository linked with the same action, the action uses the local object repository first.
– If an object with the same name is located in more than one shared object repository linked with the same action, the first occurrence of the object will be used by action.
– You can see window which is the Object Repository window (Resource->Object Repository or CTRL+R) in which you can see all objects of local and shared object repository.
– In Left side of the window, black text shows objects of local object repository
– Gray text shows objects of shared object repository.
– This figure I have taken from help of QTP, in which you can see the object detail of “buyFlights” on the left hand side.
– You can view all objects of QTP (local and shared) and you can also modify its property according to your requirements of application.
– You can copy objects from shared repository to local repository.
– This is the basic concept of Local and shared object repository if you want more detail on object repository you will find it in help of QTP.

If you like this article, You can subscribe through mail.

20 thoughts on “QTP Object Repository

  1. Lea

    I’m a beginner…I created a shared repository, and want to use it. When I’m creating a new test- I make sure to use that shared repository by “associate” with that shared repository. But new objects that are creating, they still appear as “local”. What should I do? Export and merge? What I’m doing wrong if I want always to use that shared repository ….Thank You!!!

    Reply
  2. Neelkanth

    Hi Lea,
    If you want to use “shared repository file”, you can use it by associating with that new test.(Edit->action->action propertis and then go to associate repository tab)
    After associating “shared object repository” now when again if you are recording new thing again new objects will be created in your local object repository.
    So Now you can again save these new objects to second object repository and later you can merger these two object repository by merge tool.
    Following is the procedure of merging:
    1.Go to Resource->Object Repository Manger.
    2.Tools Object repository merge tool
    3.Here you can provide two shared object repository’s location and merge it.
    I hope your doubt is clear,Let me know if your still having any issues

    Reply
  3. syamala

    Hello,

    I’m a beginner. Can any onehelp me to make a object repository as shared.

    Thanks,
    Syamala

    Reply
  4. Anonymous

    hi shyamla,
    To copy or move all of ur local objects to shared object repository do the following:
    1. Open the local object repository of the action whose objects u want to convert to shared.
    2. In the object repository window, file–>Export Local Objects
    3. Save the file with any file name with .tsr extension. (This will be ur shared object repository)

    To check open Resources–>Object Repository Manager–>The file you saved with .tsr extension.

    You will see all the same objects in non-editable format.

    Hope this helps…

    Radhika

    Reply
  5. Neelkanth

    Hi radhika,

    Thanks a lot for your inputs,

    @syamala,
    Follow above steps and in addition to that you can associate this shared object repository to your QTP test to use it.

    -> Go to Edit->action->action propertis and then go to associate repository tab, You can associate .tsr files here.

    Let us know in case of any concern.

    – Neelkanth

    Reply
  6. Anonymous

    What is the extension of Local Object Repository? How do you find it?

    Reply
  7. Anonymous

    .bdb is the extension of local object repository.

    You can see it in Action1 folder.

    Reply
  8. mysearchengine

    The way author described about the topics are really good.U wont get such an easy representation of the concepts,very easy to learn . Hats off to you.

    Suresh Krishnan

    Reply
  9. qtp-fan

    Hi QTP Experts,

    I want to know extension of local object repository. I am quite confuse as far as extension of OR is concern. At some place I came to know that .mtr is the extension of Local Object repository and at some place I came to know that .bdb is the actual extension of Object repository.
    Which one is right???

    Reply
  10. Anonymous

    In the above comments its mentioned as .bdb and .mtr are the files for local object reposiory, what is the difference between this two files.

    Reply
  11. Anonymous

    .bdb is for the local respository and .tsr is shared repository…

    * QTP Local Repository : .bdb ( berkely database)

    * Shared Repository : .tsr ( test shared repository)

    Pradeep

    Reply
  12. Anonymous

    Can anyone please let me know that whats the difference between .bdb and .mtr

    In previous comments few says that .bdb is for local OR and others syas that that .mts is for Local OR.

    please help !!

    Reply
  13. janmejay kumar

    If an object with the same name is located in both the local object repository and in a shared object repository linked with the same action, the action uses the local object repository first. why it uses local repository first…just explain….

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *