Java WebDriver在使用Firefox浏览器时抛出org.openqa.selenium.SessionNotCreatedException
我正在使用以下配置: Gecko驱动程序版本:0.17 FireFox版本:54.0.1 Selenium Java版本:3.4.0 尝试使用以下代码打开浏览器:Java WebDriver在使用Firefox浏览器时抛出org.openqa.selenium.SessionNotCreatedException,java,selenium,selenium-webdriver,geckodriver,Java,Selenium,Selenium Webdriver,Geckodriver,我正在使用以下配置: Gecko驱动程序版本:0.17 FireFox版本:54.0.1 Selenium Java版本:3.4.0 尝试使用以下代码打开浏览器: DesiredCapabilities dc = DesiredCapabilities.firefox(); dc.setCapability("marionette", true); System.setProperty("webdriver.gecko.driver", propertie
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability("marionette", true);
System.setProperty("webdriver.gecko.driver", properties.getProperty("FireFoxDriverPath"));
driver = new FirefoxDriver(dc);
但遇到以下例外情况:
失败:testRunner(“Instance1”,本地,FIREFOX,1,1)
org.openqa.selenium.SessionNotCreatedException:无法创建新的
远程会话。所需能力=能力[{marionette=true,
firefoxOptions=org.openqa.selenium.firefox。FirefoxOptions@596982,
browserName=firefox,
moz:firefoxOptions=org.openqa.selenium.firefox。FirefoxOptions@596982,
版本=,平台=任何}],所需功能=功能[{}]
构建信息:版本:'3.0.1',修订版:'1969d75',时间:'2016-10-18
09:49:13-0700'
任何人都可以澄清问题所在吗?尝试更新chrome并告诉我您的结果。您提到了
Selenium Java版本:3.4.0
正如错误堆栈跟踪所说Build info:Version:'3.0.1'
我遗漏了什么吗?Thanks@DebanjanB虽然我已经在maven dependency中将selenium版本从3.0.1更新为3.4.0,但在运行时它仍然显示为3.0.1。除了在maven中更新版本外,我还需要执行其他步骤吗?请帮忙@Saad For chrome正在成功运行。请记住执行maven清理
,下一步maven安装
,然后只执行maven测试
。那会清除所有腐烂的东西。考虑把你的<代码> GECKO 撞到V0.18.0,因为V0.18.0看起来比以前的版本更稳定一些。谢谢