Friday, February 6, 2009

Object Repository - QTP

Overview of Object Repository:

QTP Object Repository displays a tree of all objects in the current component or in the current action or entire test (depending on the object repository mode you selected).

We can view or modify the test object description of any test object in the repository or to add new objects to the repository.

QuickTest learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description. If no assistive properties are available, then it adds a special Ordinal identifier such as objects location on the page or in the source code.

QuickTest has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test.

The object repository per-action mode is the default setting. In this mode, QuickTest automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object's property values in one action, you may need to make the same change in every action (and any test) containing the object.

For any automation tool that follows OO concept the object repository forms the basis of automation frame-work. It is indeed important to make a choice between Shared & script specific (Action specific) object repository. For a web based application, it is not possible to have a shared object repository as too many objects in one .mdb file could lead to commotion especially when we have a team of automation testers. Thus, automation testers should be assigned partition specific responsibility in maintaining the object repository and updating it as when required. Further, QTP 9.0 has a wonderful drag & drop feature in creating object repository. Thus both shared as well as action specific can be maintained.
Now comes the golden question - Is it possible to create OR without using RECORD feature of QTP. Well, the answer is YES. Descriptive Programming is the best way of doing it. But for doing so the business documents should have UI mock-ups that have been reviewed and sign-off by the business experts. These mock-ups would then give the tester an idea about the various objects and their respective classes. The automation tester should than create his own repository using the describe method. But this is again time-consuming. Try avoiding descriptive programming to create OR. However, DP is the only the best option when the DEV team are developing the APP using customized objects; as a result of which QTP cannot recognize these objects. HTCs are the best example of customization. The best work-around is treating these customized objects as combination of objects and creating scripts accordingly. This is too much of trial & error method.

Once the OR is ready, then it should be maintained using QC or TD. However, during script execution the run-time is affected, but at the cost of having well-maintained OR.

No comments: