Object Repository

QTP Object Repository

what is object repository?

• Types of object repositories
    • Local repository
    • Shared repository

• Important Operations on object repository
    1. Adding objects
    2. Rename objects
    3. Delete objects
    4. Export local objects
    5. Merge repositories
    6. Associate shard repositories to an action
    7. Load repositories at run time
    8. Map objects between object repository and AUT
    9. Export test objects to .XML file/Import test objects from .XML file
    10. Define new test objects

Object repository
   It is a storage place for storing Test objects information.

Types of Object repositories
    Two types of Object repositories are available in QTP
        1. Local repository    2.Shared repository:

      1. Local repository
        It is an internal file in QTP with extension “.mtr”. QTP tool will create and maintain these internal files while recording the tests.
      QTP creates a local repository for every action during the test recording. User can edit the objects local in repository.

Navigation: Resources-->object repository         

      2. Shared repository
          It is an external file with extension “.tsr”. User has to create and maintain these external files.
 User creates shared repository either by adding objects or by exporting local objects.

During creation of shared repository there are 3 options in object repository manager to select the objects on the window /web page.
1. Select object only: it will add only parent object but not the child object on it.
2. Default object: adds all the objects on the application window/page by default.
3. All objects: adds all the objects including static objects like images also.
4. Selected object types: by selecting this option we can select one or more class of objects.
  Like all the radio buttons or/and all check boxes etc.

Operations of object repository
1.    Adding objects
2.    Rename objects
3.    Delete objects
4.    Export local objects
5.    Merge repositories
6.    Associate shard repositories to an action
7.    Load repositories at run time
8.    Map objects between object repository and AUT
9.    Export test objects to .XML file/Import test objects from .XML file
10.    Define new test objects

1. Adding objects:
  We can add objects to local repository as well shared repository also.
  But adding objects to local repository is optional.

2. Rename objects:
We can rename objects in the local repository as well shared repository also.

3. Delete objects:
We can delete objects from the local repository as well shared repository also.

4. Export local objects:

 We can export only local repository objects.

5. Merge repositories:
 By using merge option system will append the second repository to the first repository and maintain a single instance for duplicate records with the first repository object name.
It will create a separate copy of file with merged objects.

6. Associate shared repository to an action:
Association shared repository to an action is used In order to create and execute tests manually.
Advantages: context help (for objects) will be available during generation of tests.

7. Load repositories:
We also can use loading repositories at run time instead of associating shared repository to an action.
Syntax: RepositoryCollection.Add “path of the repository”

Advantage: execution performance will be high when compared with the association of shared repository. But context help for objects will not available during test creation.

8. Map objects between object repository and AUT
 By using view option we can map objects between object repository and AUT and we can rename as per our convenience based on the functionality of the object.

9. Export objects to .XML file /Import objects from .XML file:

 As .tsr files will be recognized and can be opened by QTP tool only we cannot open or modify these files if QTP tool is not available.

By using export objects option we export or import the objects into .XML file.
And we can modify objects in .XML file without launching the QTP tool.

10: Define new test objects:

By using this option we can start test design process by getting object information from developers when AUT is not ready.


Post a Comment