This question has been around for several years, so the answer may have changed. There are several different ways to do this in newer versions of Capybara, depending on the driver used.
For selenium, you can do javascript:
page.execute_script '$("#element").trigger("mouseover")'
Newer versions of selenium-webdriver support a hover method:
find('#element').hover
For capybara-webkit, the driver supports triggering events on an element:
find('#element').trigger(:mouseover)
I originally found the answer to this question from here and here .
Andrew
source share