3

I've been struggling with mouse hover for a couple of days and found a couple of threads here on the topic, but none have helped. I've tried dozens of different approaches and have also modified my code to be more in sync with the examples here, especially Dave Haeffner's suggestions. The current code looks like:

Selenium::WebDriver::Wait.new(timeout: 2).until do
  @driver.find_element(link: "ADMIN").displayed?
end
@driver.action.move_to(@driver.find_element(link: "ADMIN")).perform
Selenium::WebDriver::Wait.new(timeout: 2).until do
  @driver.find_element(link: "ORGANIZATION").displayed?
end
driver.action.move_to(@driver.find_element(link: "ORGANIZATION")).perform
Selenium::WebDriver::Wait.new(timeout: 2).until do
  @driver.find_element(link: "TEAMS").displayed?
end
@driver.find_element(link: "TEAMS").click
end

On macs, this code works fine. On Windows however, it produces:

Failure/Error: @driver.action.move_to(@driver.find_element(link: "ADMIN")).perform
Selenium::WebDriver::Error::InvalidElementStateError:
  Cannot perform native interaction: Could not load native events component.

I'm sure the element access is fine, because if I change the first mouse hover to a click action, it works great.

Any help would be appreciated.

djangofan
  • 28,471
  • 61
  • 196
  • 289
Jim Basara
  • 51
  • 3
  • Sorry, I should have provided the environment details: Windows 8.1 / Ruby 1.9.3 – Jim Basara Feb 24 '15 at 19:57
  • Are you using Firefox? This sounds like it could be an incompatibility between the version of Selenium Webdriver you're using and the installed version of Firefox... See this link: http://stackoverflow.com/questions/19922578/understanding-of-cannot-perform-native-interaction-could-not-load-native-event – David Ambler Sep 15 '15 at 15:27

1 Answers1

0

You need to use Firefox version 31.0.6 . Versions of Firefox after that don't have the native events support. If you need to use a later version of Firefox, then just make sure your test actions are all non-native, such as using a JavascriptExecutor to create a hover (instead of relying on native events in the firefox driver).

djangofan
  • 28,471
  • 61
  • 196
  • 289