How to automate opening and closing links on a web page
I have an application which has more than 50 links on each page( total 50 pages) and I want to automate opening each link and closing to see those links are not broken and working fine.
I tried recording manually but it is a very tedious process.
Any suggestions please?
Re: How to automate opening and closing links on a web page
I think this will help you..
Set oLinkDesc = Description.Create() ' Retrieve HTML tag "A" oLinkDesc("html tag").Value = "A" ' Create the collection object Set nLinksCollection = Browser("title:=.*"”).Page("title:=.*").ChildObjects(oLinkDesc) nLinksCount = nLinksCollection.Count() ' Retrieve all the requied properties For i=0 to nLinksCount-1 sName = nLinksCollection(i).GetROProperty("innertext") sHref = nLinksCollection(i).GetROProperty("href"”) Next
this code will get you all URLs in the page
If you find this useful, mark Kudos.