This article is guest blogged by QTP Blog reader Naveen Nischal from Noida, India. It will come in 2 parts. This is part I of the series. Here is your chance to be a guest writer.

With the launch of QTP 9.x series, HP has made some major enhancements with QTP object repository (i.e the way QTP stores recorded objects.)
I would discuss here some imp points regarding the two object repositories, local and shared.
Local (earlier it was Per-Action) — stores objects in a file that is associated with one specific action, so that only that action can access the stored objects. When you use a local object repository, QTP uses a separate object repository for each action. The local object repository is fully editable from within its action.
Shared (same name earlier) — stores test objects in a file that can be accessed by multiple tests (in read-only mode).
Now in QTP 9.x* series you can associate an action with:

  1. local object repository OR
  2. shared object repository OR
  3. local and one or more shared object repository OR
  4. two or more shared object repositories.

Since you can associate an action with one or more repository, there can be a conflict situation when object with the same name is present in two or more object repositories. Here are some simple rules to remember so as you would never be confused:

  1. If an object with the same name is located in both the local object repository and in a shared object repository associated with the same action, the action uses the local object definition.
  2. If an object with the same name is located in more than one shared object repository associated with the same action, the object definition is used from the first occurrence of the object, according to the order in which the shared object repositories are associated with the action.

Also remember that

  • if an action is associated with a local and shared repository, QTP will add new objects to the local object repository while recording operations and NOT to the shared one.
  • If an object is already present in either of the two repositories, QTP will not add any object and instead use the existing information.
  • QTP automatically moves a parent object(if it is in shared) to local object repository, if the child is added to the local repository.

*QTP 9.x series means QTP 9.0/ 9.1/ 9.2/ 9.5
We will discuss differences and enhancements in 9.x series Object Repository over the previous versions in Part II .
Source: QTP Documentation
Related:
Difference between QTP 8.x and QTP 9.x
Improvements in QTP 9.5
How QTP identify objects