Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
This code does not give total no of links present on page plz help it returns 0
#8
Solved: 11 Years, 2 Months ago
As I said earlier, we don't have any issues with someone asking questions all I am suggesting to you is, if you're asking similar queries, try to debug yourself first and LET US KNOW WHAT YOU TRIED to get faster and better responses.

Anyways, answering your question, this piece of code will work for any page

Code:
systemutil.Run "iexplore.exe","ansfoundation.org"

Set oLinks = Description.Create()
oLinks("micclass").Value = "Link" 'Collection of Link Objects

Set PageLinks = Browser("micclass:=Browser").Page("micclass:=Page").ChildObjects(oLinks)
msgbox PageLinks.count 'Total count

For i = 0 To PageLinks.count - 1     
msgbox PageLinks(i).GetRoProperty("href") 'Name the links
Next
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Messages In This Thread
RE: This code does not give total no of links present on page plz help it returns 0 - by Ankur - 07-25-2013, 08:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to check expected cookies are present or not priyanka.agarwal 0 1,936 07-02-2015, 12:43 PM
Last Post: priyanka.agarwal
  VB Script to count number of links in a web page. Suma Parimal 4 25,150 07-01-2015, 12:59 PM
Last Post: govind
  how to get a link present under mouseover action priyadarisini 1 2,271 12-03-2013, 08:59 PM
Last Post: Parke
  I want to compare string present on two pages excellentpawan 3 3,412 07-23-2013, 02:33 PM
Last Post: ssvali
  I want to count total no of links in a page and click one by one excellentpawan 9 7,075 07-23-2013, 11:51 AM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 3 Guest(s)