howto move mouse over and element, hover ?

170 views
Skip to first unread message

Rostislav Matl

unread,
Mar 9, 2011, 11:43:33 AM3/9/11
to webdriver

I've just tried 2.0b2 for moving mouse over certain element but
without success. I'd appreciate if somebody tells me what I do wrong:

I tried two approaches with the same result

Coordinates elementCoordinates =
((Locatable)mouseOverElement).getCoordinates();
((HasInputDevices) driver).getMouse().mouseMove(elementCoordinates);

ActionChainsGenerator builder =
((HasInputDevices)driver).actionsBuilder();
Action hoverAction = builder.moveToElement(mouseOverElement).build();
hoverAction.perform();

it results in this exception:

Exception in thread "main" java.lang.UnsupportedOperationException:
Unrecognized command: POST /session/63aeba14-5f1c-46ab-ad52-
c1f8134ebea8/moveto
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:
131)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:
105)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
410)
at org.openqa.selenium.remote.RemoteWebDriver
$RemoteMouse.mouseMove(RemoteWebDriver.java:683)
at
org.openqa.selenium.interactions.MoveMouseAction.perform(MoveMouseAction.java:
40)
at
org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:
31)

zihao

unread,
Mar 10, 2011, 9:58:02 AM3/10/11
to webdriver
I am also getting the same problem when trying to do Action.perform().
I opened a thread regarding this
http://groups.google.com/group/webdriver/browse_thread/thread/4511f3e71798ee7c
Reply all
Reply to author
Forward
0 new messages