**Urgent** java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map with WebDriver

713 views
Skip to first unread message

akay

unread,
Jan 27, 2012, 2:02:19 AM1/27/12
to seleniu...@googlegroups.com
Hi,

I am getting this error when I try to initialize the RemoteWebDriver (firefox):

java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:118)
	at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:76)
	at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:84)

This is how my code looks like:

                URL url = new URL("http://localhost:4444/node");
                System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox");
                System.setProperty("webdriver.firefox.driver", "java/selenium-firefox-driver-2.3.1");
                DesiredCapabilities dc = DesiredCapabilities.firefox();
                dc.setBrowserName("firefox");
                dc.setVersion("3.6");
                driver = new RemoteWebDriver(url, dc);

help pls. - I am totally stuck with this and not able to find much info in the web on this error

Luke Inman-Semerau

unread,
Feb 3, 2012, 11:43:26 AM2/3/12
to seleniu...@googlegroups.com
I think this error was popping up in a particular version of selenium, please upgrade to 2.18.

Also, you url should be http://localhost:4444/wd/hub  (not /node).

And I don't think those lines setting the System properties do anything when you connect to a remote server... although i could be mistaken when it's all running on localhost

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/Y5Qu5iNTLowJ.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Reply all
Reply to author
Forward
0 new messages