Selenium忽略了浏览器版本

时间:2014-12-19 09:56:27

标签: 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_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配置。如果我打电话给他们,他们只是被触发了,但我没有那个版本。

0 个答案:

没有答案