Java Selenium忽略浏览器版本

Java Selenium忽略浏览器版本,java,selenium,selenium-webdriver,selenium-grid,selenium-firefoxdriver,Java,Selenium,Selenium Webdriver,Selenium Grid,Selenium Firefoxdriver,我设置了一个selenium网格,添加了一个chrome、一个ie和两个firefox(esr和current)。在我看来,设置和调用代码是正确的,但是网格/节点忽略了我的firefox浏览器版本 我在一个节点中设置了两个浏览器: -browser browserName=firefox,version=34,maxInstances=5,firefox_binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe,firefox_profi

我设置了一个selenium网格,添加了一个chrome、一个ie和两个firefox(esr和current)。在我看来,设置和调用代码是正确的,但是网格/节点忽略了我的firefox浏览器版本

我在一个节点中设置了两个浏览器:

-browser browserName=firefox,version=34,maxInstances=5,firefox_binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe,firefox_profile=standard
-browser browserName=firefox,version=31,maxInstances=5,firefox_binary=C:\Program Files (x86)\Mozilla Firefox ESR\firefox.exe,firefox_profile=esr
它们在网格中显示为版本31和34

节点日志显示它们已添加:

10:09:21.107 INFO [1] org.openqa.grid.common.RegistrationRequest - Adding browserName=firefox,version=34,maxInstances=5,firefox_binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe,firefox_profile=standard
10:09:21.109 INFO [1] org.openqa.grid.common.RegistrationRequest - Adding browserName=firefox,version=31,maxInstances=5,firefox_binary=C:\Program Files (x86)\Mozilla Firefox ESR\firefox.exe,firefox_profile=esr
使用版本31和34调用网格时,两个请求都引用版本34实例

从网格日志:

10:10:38.865 INFO [13] org.openqa.grid.web.servlet.handler.RequestHandler - Got a request to create a new session: Capabilities [{browserName=firefox, version=31, platform=VISTA}]
10:10:38.866 INFO [10] org.openqa.grid.internal.ProxySet - Available nodes: [host :http://sel-node:5555]
10:10:38.866 INFO [10] org.openqa.grid.internal.BaseRemoteProxy - Trying to create a new session on node host :http://sel-node:5555
10:10:38.866 INFO [10] org.openqa.grid.internal.TestSlot - Trying to create a new session on test slot {firefox_binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, seleniumProtocol=WebDriver, browserName=firefox, maxInstances=5, version=34, platform=VISTA, firefox_profile=standard}
10:10:39.388 INFO [35] org.openqa.grid.web.servlet.handler.RequestHandler - Got a request to create a new session: Capabilities [{browserName=firefox, version=34, platform=VISTA}]
10:10:39.388 INFO [10] org.openqa.grid.internal.ProxySet - Available nodes: [host :http://sel-node:5555]
10:10:39.388 INFO [10] org.openqa.grid.internal.BaseRemoteProxy - Trying to create a new session on node host :http://sel-node:5555
10:10:39.388 INFO [10] org.openqa.grid.internal.TestSlot - Trying to create a new session on test slot {firefox_binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, seleniumProtocol=WebDriver, browserName=firefox, maxInstances=5, version=34, platform=VISTA, firefox_profile=standard}
10:26:37.194 INFO [35] org.openqa.grid.web.servlet.handler.RequestHandler - Got a request to create a new session: Capabilities [{browserName=firefox, version=31, platform=VISTA}]
呼叫代码为:

URL grid = new URL("http://sel-grid:4444/wd/hub");
DesiredCapabilities caps = DesiredCapabilities.firefox();
caps.setPlatform(Platform.VISTA);
caps.setVersion("31"); // or 34
WebDriver driver = new RemoteWebDriver(grid,caps);
driver.get("http://www.google.com");

我遗漏了chrome和ie的配置。如果我打电话给他们,他们会被触发,但我没有版本。

你试过这样做吗?caps.SetCapability(CapabilityType.Version,“31”);检查过了,但似乎没什么区别(您的路径中有Firefox版本34吗?没有。从命令行尝试不会启动Firefox。