firefox - Unable to call FirefoxDriver constructor -
i continuously getting unsupportedcommandexception when running following code:
system.setproperty("webdriver.firefox.bin","c:\\program files\\mozilla firefox\\firefox.exe"); firefoxprofile firefoxprofile = new firefoxprofile(); string domain = "extensions.firebug."; firefoxprofile.setpreference("app.update.enabled", false); firefoxprofile.addextension(new file("d:\\\\firebug-1.11.2-fx.xpi")); firefoxprofile.setpreference(domain + "currentversion", "1.11.2"); firefoxprofile.setpreference("extensions.firebug.cookies.enablesites", true); firefoxprofile.setpreference("extensions.firebug.allpagesactivation", "on"); firefoxprofile.setpreference(domain + "frameposition", "bottom"); firefoxprofile.setpreference(domain + "defaultpanelname", "cookies"); webdriver driver = new firefoxdriver(firefoxprofile); driver.get("http://www.google.com/webhp?complete=1&hl=en"); webelement query = driver.findelement(by.name("q"));
firefox version: 20.0, firebug 1.11.2.
error message getting under:
exception in thread "main" org.openqa.selenium.unsupportedcommandexception: bad request command duration or timeout: 437 milliseconds build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22' system info: os.name: 'windows xp', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_24' driver info: org.openqa.selenium.firefox.firefoxdriver @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(unknown source) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(unknown source) @ java.lang.reflect.constructor.newinstance(unknown source) @ org.openqa.selenium.remote.errorhandler.createthrowable(errorhandler.java:187) @ org.openqa.selenium.remote.errorhandler.throwifresponsefailed(errorhandler.java:145) @ org.openqa.selenium.remote.remotewebdriver.execute(remotewebdriver.java:554) @ org.openqa.selenium.remote.remotewebdriver.startsession(remotewebdriver.java:216) @ org.openqa.selenium.remote.remotewebdriver.<init>(remotewebdriver.java:111) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:190) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:183) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:179) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:96) @ com.vinit.tiwari.testcookiefirefox.main(testcookiefirefox.java:48)
this may hosts configuration.
if have line this:
127.0.0.1 domain1 domain2 domain3 localhost
change to:
127.0.0.1 localhost domain1 domain2 domain3