Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using GetTOProperties & Count function
#1
Solved: 10 Years, 9 Months ago
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
Reply
#2
Solved: 10 Years, 9 Months ago
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
>>>>>>>>>>>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function in a Test Script from a function library anupam4j 3 5,902 06-26-2015, 12:31 AM
Last Post: babu123
  GetTOProperties count Steve.Govinakovi 10 13,284 04-15-2014, 05:54 PM
Last Post: Anamika sinha
  Diff. between page checkpoint link count and childobj count anemuday 0 2,160 07-20-2008, 10:11 PM
Last Post: anemuday

Forum Jump:


Users browsing this thread: 1 Guest(s)