Beruflich Dokumente
Kultur Dokumente
Object repository is the heart of QTP, if you dont understand it properly than you
will face lots of problems in developing and testing of your application.
Please keep in mind following points regarding object repository:
- Test objects can be saved in two types of object repository
Local object repository and Shared object repository
- A local object repository stores objects in a file that is associated with one specific
action, so that only that action can access the stored objects
- A shared object repository stores test objects in a file that can be accessed by
multiple tests.
- When you want to create test (New project) you have two ways to store the
objects in your test.
- Store the objects in corresponding local object repository OR
- Store the objects in one or more Shared object repository. (Smart ,advanced and
efficient way) because it reduces maintenance and enhance reusability of your
tests.
Object repository concept:
- In testing the most efficient way to save objects is in shared object repository.
- You can use the same shared object repository for multiple actions, if the actions
include the same object.
- If an object with the same name is located in both the local object repository and
in a shared object repository linked with the same action, the action uses the local
object repository first.
- If an object with the same name is located in more than one shared object
repository linked with the same action, the first occurrence of the object will be
used by action.
- You can see window which is the Object Repository window (Resource->Object
Repository or CTRL+R) in which you can see all objects of local and shared object
repository.
- In Left side of the window, black text shows objects of local object repository
- Gray text shows objects of shared object repository.
- This figure I have taken from help of QTP, in which you can see the object detail of
buyFlights on the left hand side.
- You can view all objects of QTP (local and shared) and you can also modify its
property according to your requirements of application.
- You can copy objects from shared repository to local repository.
- This is the basic concept of Local and shared object repository if you want more
detail on object repository you will find it in help of QTP.
To copy or move all of ur local objects to shared object repository do the following:
1. Open the local object repository of the action whose objects u want to convert to
shared.
2. In the object repository window, file-->Export Local Objects
3. Save the file with any file name with .tsr extension. (This will be ur shared object
repository)
To check open Resources-->Object Repository Manager-->The file you saved with
.tsr extension.
You will see all the same objects in non-editable format.
EXT.
.bdb is for the local respository and .tsr is shared repository...
* QTP Local Repository : .bdb ( berkely database)
You can create output values to retrieve data during run time.
You can use regular expressions to increase the flexibility and can
avoid redundant script.
You can further enhance your test script with programming and
conditional and loop statements(If Else...End If, For Loop..etc), which
add logic to your test script.
You divide your scripts in function and Subroutine so that your script
will become more modular and generic.
Debug your test script to check that it operates smoothly and without
interruption.You can check the value of variables at run time using
debug viewer pane.The Debug Viewer pane contains the Watch,
Variables, and Command tabs. Please look in to the QTP help for more
information on debugging.
Once your script is developed and tested try to put it for regression
test as much as you can, In this way you can make your script more
stable and reliable. If you want to know more about QTP regression
framework you can visit here and can modify the framework according
to your requirement.
Please share your practical experience and thoughts so that we together can
share our friends best knowledge in the automation test planning in QTP.