Object Repository

Object Repository: OR is a storage place where we can store the object information and it also acts as an interface between Test script and AUT in order to identify the objects during execution.

Adding objects to OR:
Objects can be added to the OR using one of the two methods:
1.    By recording interactions against the application under test
2.    By manually adding one or more objects.

Navigation for manual way:  


Click on OR icon -> Click on Add objects to Local icon -> with handler icon show the object which is going to add -> Select the Define Object Filter (Selected object only, Default object type, All objects, selected object types) -> Click OK button
 

Object Repository Types:

There are 2 types of object repositories.
1.    Per Action
2.    Shared

Per Action: If at all, this type is selected the QTP will create and manage an individual repository separately for each and every action.
Extension: .mtr (module test repository)

Shared repository: Maintaining same OR to multiple tests or actions is called Shared OR

Navigation for creating SOR:

 
Click on OR icon -> Collect the objects into the OR -> File -> Export Local objects…->specify file name with extension .tsr

Navigating for associating SOR:


1)    Click on OR icon ->Tools-> Associate Repositories ->Click on ‘+’ icon ->retrieve the required or file ->Select Associate actions from Available actions -> Click on OK button.

2)    Resources menu -> Associate Repositories -> Click on ‘+’ icon ->retrieve the required or file ->Select Associate actions from Available actions -> Click on OK button.

Navigation for disassociating SOR:
1) Click on OR icon ->Tools-> Associate Repositories ->Select the existing OR file ->Click on ‘-’ icon
2) Resources menu -> Associate Repositories -> Select the existing OR file ->Click on ‘-’ icon

Object Repository operations: (Add, Rename, Delete objects/properties)
   
1)    Navigation for adding objects information:
Click on OR icon -> Click on Add objects to Local icon -> with handler icon show the object which is going to add -> Select the Define Object Filter ( Selected object only, Default object type, All objects, selected object types) -> Click OK button
2)    Navigation for renaming objects in OR:
Object Repository popup -> select the desired object -> right click on it -> Select the option rename -> specify the desired name
3)    Navigation for deleting objects in OR:
Object Repository popup -> select the desired object -> right click on it -> Select the option delete ->click on Yes on confirmation message.
4)    Navigation for updating the list of properties of an object:
OR popup -> select the desired object -> click on +/- buttons -> select the desired properties to be added or removed -> Click OK button.
5)    Navigation for updating property value:
OR popup -> select the desired object  -> select desired property in property list -> Specify the desired value in the constant field of configuration value section -> click OK button.

Highlight:
 

When ever Test Engineer is confused with some objects information in the OR window then by    
 

Highlighting the corresponding object he can get clarification which object information is that.
   
Select the object in OR -> Click on Highlight button.


Object Spy:
 

The object spy is a tool used to interrogate methods and properties supported by an object.
 

Tools -> Object Spy    (or)    click on Object Spy icon.

Contributed by: Vamsi Gowtham
m.vamsigowtham@gmail.com