Count Number of Links

How to count the number of links in web page using QTP Script?

Questions by y.sarwesh

Showing Answers 1 - 2 of 2 Answers


1) You can use Page checkpoint to find number of links in a web page.

2) Following can also do the same task:

Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
Set Links = Browser("Browser").Page("Google").ChildObjects(oDesc)
NumberOfLinks = Links.Count()
Msgbox NumberOfLinks

Manoj KS

  • Jul 21st, 2011
 

This is for webpages...

Code
  1. span style="color: #808080;">"micclass:=Browser").Page("micclass:=Page""a""Total links: "

  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