Micro Focus QTP (UFT) Forums
Description Object - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Description Object (/Thread-Description-Object--6134)



Description Object - vIns - 03-15-2012

Hi,
Is there any way to fetch the property name?

Code:
Set myObj =Description.Create
myobj("Prop1").value = "Value1"
myobj("Prop2").value = "Value2"

Using Value or Item property we can get the values.
myobj.count -> gives count
myobj.item(1) -> gives "Value2"

But how to get the property name? ie Prop1 or Prop2




RE: Description Object - ravi.gajul - 03-16-2012

The below lines should help you retrieve Prop1 and Prop2 respectively.
Code:
msgbox myobj.item(0).name
msgbox myobj.item(1).name

Regards,
Ravi


RE: Description Object - vIns - 03-16-2012

wow..thx.