In a previous article we touched upon the subject of Test Objects in QTP. To briefly summarize, Test Objects provide access to Runtime Objects (the actual objects in the AUT) and thus enable us to manipulate the AUT’s GUI and retrieve data from it, much like a human user. Basically a Test Object uses a description object to store the properties (aka attributes) and their respective values as recorded in design time; during runtime the QTP engine uses these to retrieve a valid reference to the Runtime Object.
Test Objects pertaining to different technologies and classes (e.g., WebEdit, SfwTable, etc.) may carry different sets of properties, although there are some properties which are generally commonplace or even ubiquitous (enabled), though sometimes they are implemented slightly differently (at least by name; for example, the enabled property becomes disabled in the Web).
Without delving too much into the specifics, the basic set of properties used by QTP to identify an object of a given class can be edited using Tools->Object Identification.
On the dialog that opens by pressing each of the Add/Remove buttons, it is possible to change the subset of mandatory or assistive properties from the predefined list given by QTP for any object class.
Moreover, it is possible to add custom properties (either mandatory or assistive, as said) to a given class, by pressing the New button.
This is of extreme importance because sometimes such a property is required from the AUT’s development team by the automation developer. For example, a custom property called “PAGE_DONE” taking the values of true/false can be added to a Page to enable a finer tuned synchronization of the QTP test with the AUT. This can be useful in cases where monitoring the Page readystate runtime property (with the value of 4 signaling readiness) can result in a false positive synchronization when the Page’s loading process takes several client-server requests.
About Meir Bar-Tal
Meir Bar-Tal is an Automation Architect with over 12 years of technical, educational and leadership experience in Software Design, Development and Testing. Meir has helped companies establish solid foundations for their testing activities with a wide variety of software applications and systems and across different technologies and platforms. Meir is a well-known expert in Data-Driven, Keyword Driven and Hybrid methodologies and has published a number of influential articles on the applications of Design Patterns to Test Automation. For the last five years, he has been pushing forward an ambitious program towards the development of an Object Oriented automation framework named Sunscrit, a huge project which is still underway. Meir is the owner of www.AdvancedQTP.com of which he was a co-founder in 2007 and served as its Editor in Chief, Author and Forums Administrator ever since. Meir lives in Israel and cooperates closely with HP R&D and other colleagues to improve the user experience and productivity with HP Software tools.