Friday, July 16, 2010

Tutorial 19 - QTP Object Identification

This tutorial demonstrates how Object Identification works in QTP.Before you begin , you must know an object property and its value is called Object Description used to identify the corresponding Object.For example , for a WebButton property "name" and its value "Login" together can be termed as Object Description for that Web Button.The term Unique Description implies finding typical Object Description for fast object identification.



Video Transcript with Key Takeaways highlighted

* QTP stores Object and its properties in Object Repository to identify them during run-time.
* An Object could have large number of properties associated with it. For example in Web Environment a Button could have the following properties associated.
* If QTP will try and remember all the available properties for an object, size of Object Repository will bloat and script execution time will increase drastically
* To avoid this, QTP by default , does not store all the properties of an object but a limited no of typical properties for an object which helps in its unique identification.
* These settings are store in Object Identification
* In QTP in Tools Menu , select Object Identification
* In Object Identification Dialog Box you can see a drop down of all the environments installed and loaded.
* You can select an environment and QTP auto populates list of all the supported objects belonging to that environment. On the right QTP lists the properties that will be stored for the object
* The list is divided into 2 columns 1) Mandatory & 2) Assistive
* 1) Mandatory properties will be stored by default for that object
* 2) In case during record time of script QTP can NOT create a unique description of the object it will store the assistive properties
* To understand this better consider the example of an Image. QTP will store value of alt ,html tag, image type, properties mandatory even if it can uniquely identity it using the alt property alone.
* In case it can not create unique description using mandatory property ,QTP will store assistive property. In this case QTP will store the class property .
* If this property helps create a unique description of the object, QTP will not store file name, height property. If class property is not sufficient to create unique description, QTP will store file name property . If file name property creates a unique description QTP will not store height property and so on.
* Suppose during Record Time, QTP has only stored class property
* At Run - time ,QTP will forget the distinction between mandatory and assistive properties and compare all the recorded properties.
* Even if any one of the properties does not match its stored value , Script fails

No comments:

South Beach Smoke E-Cigarette - The Better Smoking Choice