Friday, July 29, 2011

QTP - Webpage Links

Count links in webpage:

Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
Set
Links = Browser("version:=internet explorer 8").Page("title:=Google").ChildObjects(oDesc)
Msgbox "Total links: " & Links.Count



Get text in links:
For
i=1 to Links.Count-1
 Msgbox Links(i).GetROProperty("text")
Next

No comments:

Post a Comment