Local and Shared Object Repositories in QTP Tool

In this article we discuss Local and Shared Object Repositories in the QTP Tool

Understanding Test Object Descriptions

1 image.jpg

For each test object class, Quick Test learns a set of identification properties when it learns an object and selects a subset of these properties to serve as a unique object description.

Quick Test then uses this description to identify the object when it runs the test. For example by default, Quick Test learns the image type such as plain image or image buttons.

The HTML tag and the Alt text of each Web image it learns.

If these three mandatory property values are not sufficient to uniquely identify the object within its parent object, Quick Test adds some acquisitive properties and/or an ordinal identifier to create a unique description.


Understanding Object Repository Types

test flow chart.jpg

Objects can be stored in two types of object repositories; a shared object repository and a local object repository.

A shared object repository stores objects in a file that can be accessed by multiple tests (in read only mode).

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.

Understanding the Local Object Repository

LocalOR1.jpg

When you use a local object repository, Quick Test uses a separate object repository for each section. The local object repository is fully editable from within its action.

When working with a local object repository:

  1. Quick Test creates a new object repository for each action.
  2. When Quick Test learns new objects either because you add them to the local object repository or you record on objects in your application, it automatically stores the information about those objects in the corresponding local object repository if the test objects do not already exist in an associated shared object repository.
  3. Quick Test adds all new objects to the local object repository even if one or more shared object repositories are already associated with the action. (This assumes that an object with the same description does not already exist in one of the associated shared object repositories.)
  4. If a child object is added to a local object repository and its parents are in a shared object repository its parents are automatically added to the local object repository.
  5. Every Time you create a new action, Quick Test creates a new, corresponding local object repository and adds test objects to the repository as it is learned.
  6. If Quick Test learns the same object in your application in two different actions, the test object is stored as a separate test object in each of the local object repositories.

Understanding the Shared Object Repository

Object Repository.jpg

When you use shared object repositories, Quick Test uses the shared object repositories you specify for the selected action. You can use one or more shared object repositories.

After you begin creating your test, you can specify additional shared object repositories.

You can also create new ones and associate them in with your action. Before running the test, you must ensure that the object repositories being used by the test contain all of the objects in your test.

When working with a shared object repository:

If Quick Test Professional learns a test object that already exists in either the shared or local object repository, Quick Test uses the existing information and does not add the object to that object repository.

If a child object is added to a local object repository and its parents are in a shared object repository its parents are automatically moved to the local object repository.