Programming

QTP Object Repository

QTP Object Repository:

When QuickTest runs a component, it simulates a human user by moving the pointer over the application, clicking objects, and entering keyboard input. Like a human user, QuickTest must learn the interface of an application to be able to work with it. QuickTest does this by learning the application’s objects and their corresponding property values and storing these object descriptions in an object repository.

For each test object you select in the tree, the Object Repository window displays information on the test object, its type, the repository in which it is stored, and its test object details.

Test Object Details

Description properties The properties and property values used to identify the object during a run session. You can add and remove properties to or from the test object description.

Ordinal identifier A numerical value that indicates the object’s order or location relative to other objects with an otherwise identical description (objects that have the same values for all properties).

Additional details Contains the following options:

– Enable Smart Identification. Enables you to select True or False to specify whether QuickTest should use Smart Identification to identify the test object during the run session if it is not able to identify the object using the test object description.

– Comment. Enables you to add textual information about the test object.

– You are creating components using keyword-driven methodologies (not using record).

– You have several components that test elements of the same application, interface, or set of objects.

– You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties.

Understanding the Local Object Repository

• When you use a local object repository, QuickTest uses a separate object repository for each component. (You can also use one or more shared object repositories if needed. The local object repository is fully editable from within its component.

• When working with a local object repository:

– QuickTest creates a new (empty) object repository for each component.

– As you record operations on objects in your application, QuickTest automatically stores the information about those objects in the corresponding local object repository (if the objects do not already exist in an associated shared object repository).

– QuickTest adds all new objects to the local object repository even if one or more shared object repositories are already associated with the component. (This assumes that an object with the same description does not already exist in one of the associated shared object repositories).

– 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.

– Every time you create a new component, QuickTest creates a new, corresponding local object repository and begins adding test objects to the local object repository as you record or learn objects.

– If you learn or record on the same object in your application in two different components, the object is stored as a separate test object in each of the local object repositories.

– When you save your component, the local object repository is automatically saved with it. The local object repository is not accessible as a separate file (unlike the shared object repository).

Understanding the Shared Object Repository

• When you use shared object repositories, QuickTest uses the shared object repositories you specified for the selected component’s application area. You can use one or more shared object repositories.

• After you begin creating your component, you can specify additional shared object repositories. You can also create new ones and associate them with your component. Before running the component, you must ensure that the object repositories being used by the component contain all the objects in your component. Otherwise, the component may fail.

• You modify a shared object repository using the Object Repository Manager.

• When working with a shared object repository:

– If you record operations on an object that already exists in either the shared or local object repository, QuickTest uses the existing information and does not add the object to the 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.

– QuickTest does not add an object to the shared object repository as you record operations on it. Instead, it adds new objects to the local object repository (not the shared object repository) as you learn objects or record steps on them (unless those same objects already exist in an associated shared object repository).

• You can export the local objects to a shared object repository.

• You can also merge the local objects directly to a shared object repository that is associated with the same component. This can reduce maintenance since you can maintain the objects in a single shared location, instead of multiple locations.