Micro Focus QTP (UFT) Forums
Using GetTOProperties & Count function - 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: Using GetTOProperties & Count function (/Thread-Using-GetTOProperties-Count-function)



Using GetTOProperties & Count function - Akhila - 06-24-2008

Hi,

Using GetTOproperties example from QTP help guide,i modified following script to get property count for the link("Gmail Blog"),
but its giving error.
Can anyone advice how can I get the property count & list of properties as output.

<<<<<<<
Code:
Dim props()
props = Browser("Gmail: Email from Google").Page("Gmail: What's been keeping").Link("Gmail Blog").GetTOProperties()
propscount = props.count
msgbox(propscount)
For i = 0 To propscount - 1
    propName = props(i).Name
    propValue = props(i).Value
    MsgBox propName & " = " & propValue
Next
>>>>>>>>>>>

Thanks,
Akhila


RE: Using GetTOProperties & Count function - surya_7mar - 07-07-2008

here is the small change to your script

Code:
Dim props()
'You need to set the All the Properties to a Object, you can directly assign to a variable
Set  props = Browser("Gmail: Email from Google").Page("Gmail: What's been keeping").Link("Gmail Blog").GetTOProperties()
propscount = props.count ()  ' While assigning count to a variable you need to call using ()
msgbox(propscount)
For i = 0 To propscount - 1
propName = props(i).Name
propValue = props(i).Value
MsgBox propName & " = " & propValue
Next
>>>>>>>>>>>