11-19-2015, 02:08 PM
A Description Object in QTP is a collection of test object property and value pairs. Each object in the app classifies to be part of a collection. It is a very powerful approach to create object collections – each object in the collection will resemble each other by the property-value pairs specified by a description object.
Description.Create is used to create a 0-based Properties collection object. The variable oDesc is preceded by the Set statement. Usage of Set statement binds an object as a reference to another object. Therefore, oDesc becomes an object reference to the description object represented by Description.Create. A description object does not have a stand-alone use, but coupled with the ChildObjects method, it becomes an extremely powerful approach in dealing with AUT’s objects.
Code:
Set oDesc = Description.Create
Description.Create is used to create a 0-based Properties collection object. The variable oDesc is preceded by the Set statement. Usage of Set statement binds an object as a reference to another object. Therefore, oDesc becomes an object reference to the description object represented by Description.Create. A description object does not have a stand-alone use, but coupled with the ChildObjects method, it becomes an extremely powerful approach in dealing with AUT’s objects.