Wednesday, July 06, 2011

Selenium clicking links from Safari/Opera not working

There have been lots and lots of solutions proposed for this problem. Let me add mine to the list.

Here is what I was facing: the following (very simple) link click
$link->selenium->click("//td[5]/a/img");

works perfectly in Firefox, IE and Google Chrome but results in no action in Safari or Opera. No error is generated but no change to the website occurs.

After pulling my hair out for two days, I noticed that at the bottom of the Firefox window, the link that results was displayed.


So I changed the command to
$link->selenium->open("main.php?action=adm_overview&lang=de");

And voila!...it was exactly the same as clicking on the link.

If Firefox dos not display the link (for instance, if it displays the Javascript that will be called), then try to use a tool like Webscarb to intercept the outgoing message.
  • Book reviews