I have a simple CSS-based dropdown menu, and I'm trying to click on one of the menu items in a Java Selenium (WebDriver) test.
Both the menu (<ul>
element) and the items (<a>
) have IDs and creating corresponding WebElement
objects works fine. I'm trying to click on one of the items with code like:
hoverOver(transfersMenu);
transferLink.click();
In hoverOver()
, I've tried all three answers from this question, but none of them work. I keep getting:
org.openqa.selenium.ElementNotVisibleException:
Element is not currently visible and so may not be interacted with
Command duration or timeout: 2.06 seconds
(I've tried calling transferLink.click()
also before hoverOver()
, in the hope that the implicit wait would make it work, but nope.)
Any idea how to make the hovering work so that the link can be clicked?
Selenium version 2.21.0. I'm running the tests on Linux (Ubuntu), using Firefox 13.0. A colleague just tried on Windows (using Firefox 12.0), and it didn't work for him either.
Update: As per Slanec's tip in comments, and these instructions, I tried setEnableNativeEvents(true)
on the FirefoxProfile
. At first this failed:
org.openqa.selenium.InvalidElementStateException:
Cannot perform native interaction: Could not load native events component.
...but after I upgraded to Selenium 2.23.1, I no longer get that complaint.
Still, the hovering doesn't work (with native events on or off). :-/