Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hover over (mouseover) an element in Selenium Ruby?

Anyone know how to hover over an element in Selenium Ruby Webdriver?

My code is like this:

el = driver.find_element(:css => "#foo")
driver.move_to el # How do I trigger a mouseover event on this element?

I'm using selenium-webdriver gem with Firefox in Linux 32-bit.

like image 311
kidcapital Avatar asked Sep 01 '11 01:09

kidcapital


1 Answers

I used driver.action.move_to(el).perform which differs ever so slightly from the other answers, so I thought I would include it for completeness sake.

like image 129
Seanny123 Avatar answered Sep 28 '22 10:09

Seanny123