I am trying to automate a web application having javascript.
I am using WWW::Scripter for it.
for clicking on a link, I am using following code but it seems that MouseEvent is not supported.
$wi->eval ('var theEvent = document.createEvent("MouseEvent");');
$wi->eval ('theEvent.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);');
$wi->eval ('var element = document.getElementsByTagName("li")[3].getElementsByTagName("a")[0];');
$wi->eval ('element.dispatchEvent(theEvent);');
Do we have any other way to accomplish it.
1 Answer