Highlighted
Absent Member.
Absent Member.
179 views

How to automate opening and closing links on a web page

Hi,

 

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?

 

Thanks,

SEGA

0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

Re: How to automate opening and closing links on a web page

Hi Sega,

 

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

 

 

////Kiran////

 

If you find this useful, mark Kudos.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.