How do we count links on the web page displayed?

Supposed there are some 2o links in web page how do we give count of them
if the links ar there in an weblist object.
can we use getrop(itemcount)
or how we vil put page check point,pls do me needful.
Thanks
sudha

Questions by srisudha1846   answers by srisudha1846

Showing Answers 1 - 3 of 3 Answers

Dipak123

  • Jun 24th, 2008
 

We can Count the number of links in a webpage in two ways

1) Using the Description Object and ChildObjects Method
Set oDesc = Description.Create()
oDesc("html tag").Value = "A"
Set mylinksColl = Browser().Page().ChildObjects(oDesc)
Msgbox mylinksColl.Count
Set mylinksColl = Nothing
Set oDesc = Nothing

2) Using the Object Property

Msgbox Browser().Page().Object.links.Count



Dim oLinks

Set oLink = Description.Create()
oLink("micclass").Value = "Link"
oLink("html tag").Value = "A"

Msgbox Browser("title:=.*").Page("title:=.*").ChildObjects(oLinks).Count

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions