Java 获取错误org.openqa.selenium.WebDriverException:转发firefox安装功能的VM新会话空池时出错

Java 获取错误org.openqa.selenium.WebDriverException:转发firefox安装功能的VM新会话空池时出错,java,selenium,selenium-grid,selenium-firefoxdriver,Java,Selenium,Selenium Grid,Selenium Firefoxdriver,我正在使用: java:1.8 硒:3.141.59罐 Geco驱动程序版本:0.25.0 Firefox版本:69.0.1 下面是executable.bat文件的详细信息: start java -jar C:/eclipse-workspace/Selenium_Grid/Config/selenium-server-standalone-3.141.59.jar -role hub start java -Dwebdriver.chrome.driver=D:/Selenium/chr

我正在使用: java:1.8 硒:3.141.59罐 Geco驱动程序版本:0.25.0 Firefox版本:69.0.1

下面是executable.bat文件的详细信息:

start java -jar C:/eclipse-workspace/Selenium_Grid/Config/selenium-server-standalone-3.141.59.jar -role hub

start java -Dwebdriver.chrome.driver=D:/Selenium/chromedriver_win32/chromedriver.exe -jar C:/eclipse-workspace/Selenium_Grid/Config/selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -port 5558 -maxSession 5 -browser browserName=chrome,maxInstances=10 

start java -Dwebdriver.gecko.driver=D:/Selenium/geckodriver-v0.25.0-win64/geckodriver.exe -jar C:/eclipse-workspace/Selenium_Grid/Config/selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -port 5559 -maxSession 5

代码如下:

公共静态RemoteWebDriver getBrowserDriver(最终字符串浏览器)
抛出错误的DurException{
返回新的RemoteWebDriver(新URL(“http://localhost:4444/wd/hub"),
getBrowserCapabilities(浏览器));
}
私有静态DesiredCapabilities getBrowserCapabilities(
最后一个字符串(browserType)引发畸形的DurLexException{
开关(browserType.toLowerCase()){
案例“firefox”:
System.out.println(“打开firefox驱动程序”);
DesiredCapabilities=DesiredCapabilities.firefox();
setBrowserName(“firefox”);
setPlatform(Platform.WIN10);
返回能力;
}
}
在运行代码时,获取以下异常日志:

org.openqa.selenium.WebDriverException:为安装功能转发新的虚拟机会话空池时出错{AcceptSecureCerts:true,browserName:firefox,marionette:true,平台:WIN10,版本:} 命令持续时间或超时:801毫秒 构建信息:版本:“3.141.59”,修订版:“e82be7d358”,时间:“2018-11-14T08:25:48” 系统信息:主机:'GP-PIN-IS04',ip:'192.168.250.72',os.name:'Windows 10',os.arch:'amd64',os.version:'10.0',java.version:'1.8.0_221' 驱动程序信息:Driver.version:RemoteWebDriver 原因:org.openqa.grid.common.exception.GridException:为安装功能转发VM的新会话空池时出错{AcceptInsureCerts:true,browserName:firefox

因此,您的错误为“错误转发新会话空VM池以获得安装功能”这意味着它正在寻找与您在创建远程驱动程序时要求的功能相匹配的节点,但找不到。在启动geckodriver的行中,您没有指定与chrome浏览器类似的浏览器。在启动节点时,可能更容易创建节点配置文件并将其传入像这样:

java -Dwebdirver.gecko.driver="D:/Selenium/geckodriver-v0.25.0-win64/geckodriver.exe" -jar selenium-server-standalone-3.8.1.jar -role node -hub "http://localhost:4444/grid/register/" -port 5559 -nodeConfig config.json
以下是firefox节点的配置文件:

 {
 "capabilities": [
   {
     "browserName": "firefox",
     "platform": "WIN10",
     "maxInstances": 5
   }      
 ],
 "hub": "http://<hub ip>:<hub port>"
 }
{
“能力”:[
{
“浏览器名”:“firefox”,
“平台”:“WIN10”,
“最大实例”:5
}      
],
“集线器”:“http://:”
}

请编辑您的问题,并添加网格控制台的屏幕截图,以便我们了解正在注册的浏览器风格(拍摄屏幕截图时,不要忘记切换到网格控制台的
配置
选项卡)感谢Krishnan的回复,我附上了屏幕截图作为指导,请让我知道我是否还需要其他任何东西。更新:问题在Firefox更新版本69.0.2之后得到解决,同样关于使用firefoxoptions和合并功能,下面是示例:DesiredCapabilities=new DesiredCapabilities();capabilities.setBrowserName(“firefox”);capabilities.setPlatform(Platform.WINDOWS);FirefoxOptions=new FirefoxOptions();options.merge(功能);感谢Shannon的回复,但即使使用配置方式,仍然会出现相同的错误。也许尝试更新你的网格jar?看起来你使用的是一个非常旧的。我使用的是3.141.59 selenium服务器jar,也是gecko驱动程序0.25.0版本,如果这些是旧的,请引导我找到最新的jar下载链接。嗨,Keshav,这里有一个下载该jar的链接我正在使用3.8.1,但他们也推出了Selenium 4