HasInputDevices Not working for selenium java 2.37.0

4,115 views
Skip to first unread message

Aryasindhu Sahu

unread,
Oct 28, 2013, 3:13:54 AM10/28/13
to seleniu...@googlegroups.com
Hi,

I have upgraded from selenium-java-2.35.0 to selenium-java-2.37.0. I had a method to hover over element.

Mouse mouse = ((HasInputDevices) driver).getMouse();

This was working for 2.35 but now shows error in 2.37 as :

java.lang.ClassCastException: org.openqa.selenium.remote.RemoteWebDriver cannot be cast to org.openqa.selenium.interactions.HasInputDevices


JT

unread,
Oct 31, 2013, 2:48:59 PM10/31/13
to seleniu...@googlegroups.com
I was having the same issue. Do you have any other dependencies in your project that also rely on selenium? In my case, I had a dependency on PhantomJSDriver 1.0.4, which had a transitive dependency on selenium-remote-driver version 2.33. I believe in this older version HasInputDevices is in a different package, thus causing the exception. Anyway, I excluded this transitive dependency and it solved the problem.

Simon Stewart

unread,
Nov 3, 2013, 10:33:12 AM11/3/13
to seleniu...@googlegroups.com
Check your imports. We recently moved HasInputDevices to the "org.openqa.selenium.interactions" package. If you're using older client bindings, it may still be in the original package (and so Java considers it a different class)

Cheers,

Simon


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/13097acd-aa85-4f8a-a2d6-55a67f20fd3c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Pushpraj Singh

unread,
Apr 1, 2014, 4:38:39 AM4/1/14
to seleniu...@googlegroups.com
Hi Stewart, 

I checked and yes it is present in "Interactions". But I don't understand it is keep on looking in previous directory i.e. org.openqa.selenium instead of org.openqa.selenium.interactions. I dont know why?
I have tried :
1. mvn clean install
2. manually include this selenium-api-2.40.0.jar in build path
3. Include "HasInputDevices" class.
But none worked. Please let me know what I am missing,

JT

unread,
Apr 1, 2014, 8:31:26 PM4/1/14
to seleniu...@googlegroups.com
Run "mvn dependency:tree" and see if any of the selenium jars have different versions. If you find some mismatches, they're likely transitive dependencies, so you could try excluding them from whatever dependency is pulling them into your project.
Reply all
Reply to author
Forward
0 new messages