I am trying to click a link on a page, it don’t have any id and not having a unique class name. Only unique thing about the function is the onclick handler
<a href="#" onclick="closepopup('popup', 'popuphandler')" > </a>
I need to click this link via vbscript automation, for the same i tried the code as:
Set allLinks = ie.document.links
for j = 0 to allLinks.length-1
if allLinks(j).onClick = "closePopup(""popup"",""popupClose"")" then
allLinks(j).click
j = allLinks.length 'class name = blueButtonCenter
end if
Next
But it is not working, please help.
Thanks in advance 🙂
I would try to check if the closePupup is found in the actual javascript, like so:
This assumens onClick delivers a string, (at least in javascript it does and in IE9 and Chrome this works)