Types of Object Repositories in QTP

Object Repositories in QTP

QTP mechanism is storing the objects in Object Repository(OR) to identify the run time objects in the applications

All actions users do on during recording is automatically added to object repository.

Ex. Dialog(“Login”).WinEdit(“Agent Name:”).Set “Admin”

In the above example Login, Agent Name are different objects that will store in object repository after recording an object in the application.

Remember!  Object stored in the object repository are particular to that test only, in order to run the same code in different code then object repository needs to be copied and used for the particular test.

Types of object Repositories in QTP

Shared Object Repository

Per-Action Object Repository or Local Object Repository

Shared Object Repository

It’s a common or central location to store all objects, can be used by multiple scripts, it can be updated by all actions accessing it, Preferable when object is dynamic, this type of object repository is being used by most automation projects, difficult thing is it needs maintenance and administration.

Per-Action Object Repository

Objects stored under the object repository are particular to the test, QTP by default mode is Per-Action Object Repository, This type of Object Repository uses when application is not dynamically changes with respect to time intervals, the most import thing is, it cannot be reusable.

How to open Object Repository:

Use a shortcut CTRL+R

Else

Select Tools Menu->Object Repository

After opening an object Repository dialog box displays a test tree of all objects in the current action or the entire test depending on the object repository mode selected by the user, we can either modify the object name according to our convenience, For ex. Instead of Flight Reservation we can Enter FR short name; same short name can be selected across the script.

Object Repositories in QTP -Local

Below image shows how to  change object names in User defined way

Object Repositories in QTP-Menu

Below image shows how to use user defined names in scripting

Object Repositories in QTP-In Keyword view

How to choose object repository type:

From File Menu ->Settings->under test settings Dialog select Resources TAB then select object repository type (in QTP 9.2 and later versions)

Test and Run Time Objects in QTP

Test objects are the objects which stored by QTP to identify in the application, each Test object supports sets of methods and properties, the actual object in the AUT which is identified for a test object is called “Run Time object”

A Test object can always be present without AUT

1 thought on “Types of Object Repositories in QTP”

Leave a Reply

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