Friday, December 24, 2010

Object Repository in Quick Test Professional (QTP)

Test objects: are stored representations of the actual objects (or controls) in your application. QuickTest creates test objects by learning a set of the properties and values of the objects in your application
Run-time objects: are actual objects (or controls) in your application during a run session. Run-time objects are not stored in an object repository, as they are available only during the run session.
Object Repositories
QuickTest can store the test objects it learns in two types of object repository files, shared and local.
Shared Object Repository in QTP
QTP Shared object repository
(Click on the image to enlarge)

A shared object repository contains test objects that can be used in multiple actions. By associating a shared object repository with an action, you make the test objects in that repository available for use in the action. (.tsr)
1. If QuickTest Professional learns a test object that already exists in either the shared or local object repository, QuickTest uses the existing information and does not add the object to that object repository.
2. You cannot add checkpoint or output value objects to a shared object repository via the Object Repository Manager.
3. Test objects of environments that are not installed with QuickTest will be displayed with an unknown icon (question mark) in the object repository.
4. The Navigate and Learn option enables you to add multiple test objects to a shared object repository while navigating through your application.
5. You can also modify a shared object repository by merging it with another shared object repository. If you merge two shared object repositories, a new shared object repository is created, containing the content of both object repositories.
6. The Comparison Tool automatically identifies objects during the comparison process by classifying them into one of the following types as identical, matching description different name, similar description, unique in first and unique in second file
7. You can import and export object repositories from and to XML files.

Local Object Repository in QTP
QTP Local Object Repository
(Click on the image to enlarge)

A local object repository stores test objects that can be used in one specific action. The objects in this type of repository cannot be used in any other action. Local object repositories are useful for backing up your test objects, or for learning one or several objects (using the Navigate and Learn tool or by recording on them). (.mtr)
1. QuickTest creates a new (empty) object repository for each action.
2. When QuickTest learns new objects ,it automatically stores the information about those objects in the corresponding local object repository
3. QuickTest 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 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 moved to the local object repository.
5. Every time you create a new action, QuickTest creates a new, corresponding local object repository and adds test objects to the repository as it learn them.
6. If QuickTest 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.
7. When you save your test, all of the local object repositories are automatically saved with the test (as part of each action within the test). The local object repository is not accessible as a separate file (unlike the shared object repository).
8. You can export objects from the local object repository to a shared object repository. You can also export the local object repository and replace it with a shared object repository. This enables you to make the local objects accessible to other actions.

Also see Object repository - Comparison and Merge tools, How to deal with Dynamically changing objects in QTP & QTP beginner's tutorial.

No comments:

Post a Comment

Please leave your comment here...