Selenium: Why doesn't click () behave like it does in Firefox?
I have a link with id:
<a href="#" onclick="return false();" id="lol"> In my test:
selenium.click("lol"); //when running the test, the click will just end up selecting the item, not firing off the frameworks javascript This does not register a click though! There is javascript that is part of a complex structure that will pop up a div popup. This works in firefox.
But this works as a fix:
selenium.click("lol"); //when running the test, the click will just end up selecting the item, not firing off the frameworks javascript selenium.keyPress("lol", "\\13"); //press enter key, since the click ended up selecting it The fix works. But what is going on here? Selenium.click ()! = [Actual browser click event] seems to be. Can anyone help shed light on these inner works?
You can click the link in the browser before downloading javascript. See this other question . One solution would be to expect some element to appear on the page that is placed there javascript.