Considered the heart of QTP and Automation, the Object Repository is the brain that holds all object properties. QTP Tutorial recognizes the fact that non-mastery of the Object Repository feature will create problems in developing and testing applications. This video will focus on the mechanics of the Object Repository in identifying objects.
The Object Repository automatically adds test objects which are identified by a logical name (as assigned by QTP) which contain a set of properties that uniquely identify each object. The Object Repository has several features, one of which is “add object to local”. Using the Yahoo application, we added Mail and Web Edit, in which the hierarchy showed p. One of the unique functions of the Object Repository is that you can perform several actions, including renaming, thus, we renamed p to Search Bar. It is important to use descriptive names to objects so you can easily identify them.
One of two types of Object Repository is the Local Object Repository. In the Local Object Repository, QTP automatically creates an object repository file for each action. In this case, only Action 1 can access Yahoo. You can add more objects in the repository so you can create and run tests under one action without modifying repository files.
Another feature of the Object Repository is “define test object”. This is used when the Object Spy could not properly identify object properties. Using the Record method, we came up with:
To add a new test object, simply copy and paste properties as seen in the text format. Here we tried adding three properties: innertext, link and html tag. Unfortunately, all three yielded the same result – that the object does not have unique properties therefore, is not unique. It is important to note that having more properties for identification is not always better. The key is to find a combination of unique properties with unique values that will make the object unique. This is where the Ordinal Identifier enters the picture.
Take a second to Tweet our site link. We appreciate your support!
Latest posts by Admin (see all)
- SQA QTP tutorial – WebList identified as a web element and how to select an item from this list - December 9, 2015
- Automation QTP tutorial-double clicking on any object - December 4, 2015
- Software Automation QTP tutorial – 5 top reasons for using automation - November 23, 2015