David
David

Reputation: 197

Selenium - Unable to mouse over with Firefox

Has anyone found a workaround for mouse hover over an element in Firefox, given the following issue?

org.openqa.selenium.UnsupportedCommandException: mouseMoveTo
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'

The command works on Edge, IE, Chrome.

I'm using the latest geckodriver (0.18.0) and Firefox (54.0.1)

Upvotes: 1

Views: 1651

Answers (1)

Gaurang Shah
Gaurang Shah

Reputation: 12920

I can see there is a bug opened for this. https://github.com/SeleniumHQ/selenium/issues/4008

However, as a work around you could try to change geckodriver or Firefox version. if this is not possible you could always use javascript to scroll to element.

je.executeScript("arguments[0].scrollIntoView(true);",element);

However this will only put the Element into View Port. It won't put mouse over and element. So it won't generate any Mouseoever event if you are interested in.

The reason for this is very simple, The mouse movement is controlled by your OS and not JavaScript. It's by design for security.

Upvotes: 2

Related Questions