Exception in thread "main"
org.openqa.selenium.WebDriverException: java.util.HashMap cannot be cast to java.lang.StringCommand duration or timeout: 1.58 seconds
Build info: version: '2.24.1', revision: '17205', time: '2012-06-19 17:28:14'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_03'
Driver info: driver.version: RemoteWebDriver
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/1FdfcLEIMHwJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
Exception in thread "main"
org.openqa.selenium.WebDriverExceptionCommand duration or timeout: 2.29 seconds
Build info: version: '2.24.1', revision: '17205', time: '2012-06-19 17:28:14'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_03'
Driver info: driver.version: RemoteWebDriver
Session ID:
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(
Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
ErrorHandler.java:188)at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
ErrorHandler.java:145)at org.openqa.selenium.remote.RemoteWebDriver.execute(
RemoteWebDriver.java:472)at org.openqa.selenium.remote.RemoteWebDriver.startSession(
RemoteWebDriver.java:155)at org.openqa.selenium.remote.RemoteWebDriver.<init>(
RemoteWebDriver.java:107)at org.openqa.selenium.remote.RemoteWebDriver.<init>(
RemoteWebDriver.java:115)at TrailAndTest.MainClass.main(
MainClass.java:154)Caused by:
java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.Stringat org.openqa.selenium.firefox.FirefoxDriver.getBinary(
FirefoxDriver.java:167)at org.openqa.selenium.firefox.FirefoxDriver.<init>(
FirefoxDriver.java:100)at sun.reflect.NativeConstructorAccessorImpl.newInstance0(
Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:57)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(
Constructor.java:532)at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(
DefaultDriverFactory.java:57)at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(
DefaultDriverFactory.java:51)at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(
DefaultSession.java:196)at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(
DefaultSession.java:1)at java.util.concurrent.FutureTask$Sync.innerRun(
FutureTask.java:334)at java.util.concurrent.FutureTask.run(
FutureTask.java:166)at org.openqa.selenium.remote.server.DefaultSession$1.run(
DefaultSession.java:150)at java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1110)at java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:603)at java.lang.Thread.run(
Thread.java:679)Hi DC ,
How did u solved this issue?
I am using selenium 2.26 .jar
My Code:
public static void main(String[] args) throws IOException {
RemoteWebDriver rdriver= null;
// Setup firefox binary to start in Xvfb
String Xport = System.getProperty("lmportal.xvfb.id", ":1");
final File firefoxPath = new File(System.getProperty("lmportal.deploy.firefox.path", "/usr/bin/firefox"));
FirefoxBinary firefoxBinary = new FirefoxBinary(firefoxPath);
firefoxBinary.setEnvironmentProperty("DISPLAY", Xport);
// Start Firefox driver
//WebDriver driver = new FirefoxDriver(firefoxBinary, null);
DesiredCapabilities capability = null;
capability = DesiredCapabilities.firefox();
capability.setCapability(FirefoxDriver.BINARY, firefoxBinary);
capability.setJavascriptEnabled(true);
rdriver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
rdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://google.com/");
// Take snapshot of browser
File srcFile = ((TakesScreenshot)rdriver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(srcFile, new File("ffsnapshot1.png"));
rdriver.quit();
Issue :
stack trace :
xception in thread "main" org.openqa.selenium.WebDriverException: java.util.HashMap cannot be cast to java.lang.String
Command duration or timeout: 191 milliseconds
Build info: version: '2.26.0', revision: '18041', time: '2012-11-01 19:33:38'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-30-generic', java.version: '1.6.0_29'
Driver info: driver.version: RemoteWebDriver
Session ID:
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:188)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:531)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:215)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at com.socialtwist.taf.webdriver.Test.main(Test.java:44)
Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.String
at org.openqa.selenium.firefox.FirefoxDriver.getBinary(FirefoxDriver.java:171)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:99)
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.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:57)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:51)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:196)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:150)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/AvnOLkYbkyYJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/kVig31IhJlMJ.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.