我正在尝试将 Selenium Grid 与 Jenkins 一起使用。当我使用服务器独立的 2.35.0 jar 启动 Selenium Hub 和 Node 时,一切正常。但是,当我使用 Jenkins Selenium Grid 插件作为集线器时不起作用。
错误出现在这里:
driver = new RemoteWebDriver(新 URL(gridURL),功能);
网格 URL 是"http://localhost:4444/wd/hub"
能力是这样的:
DesiredCapabilities capabilities = DesiredCapabilities.firefox ();
capabilities.setPlatform ( Platform.LINUX );
抛出此异常:
org.openqa.selenium.WebDriverException: Error forwarding the new session new session request for webdriver should contain a location header with the session.
Command duration or timeout: 25.28 seconds
Build info: version: '2.35.0', revision: '8df0c6bedf70ff9f22c647788f9fe9c8d22210e2', time: '2013-08-17 12:46:41'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.8.0-31-generic', java.version: '1.7.0_40'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
作为集线器,我使用 Jenkins Selenium 插件版本 2.3 作为节点,我使用 selenium-server-standalone-2.35.0.jar。
当我http://localhost:4444/
用浏览器打开时,它说:You are using grid 2.29.0
所以我下载了 selenium-server-standalone-2.29.0.jar 并让它作为集线器运行。该节点仍然是版本 2.35.0。然后我有同样的例外。我尝试使用 2.29.0 的节点和集线器,但似乎我的 Firefox 对这个来说太新了。
我搜索了几个小时,但没有找到有关此错误的任何信息。
编辑:由 Jenkins 安装的插件从 2013 年 8 月 18 日开始:https ://wiki.jenkins-ci.org/display/JENKINS/Selenium+Plugin
两天后的 2013 年 8 月 20 日,开发人员更新了插件:https ://github.com/jenkinsci/selenium-plugin/commit/316eccdef608e855863cf04b1c240fa2c7b8b762
我不知道这是否会导致我的错误,但这是可能的。我还不知道如何做到这一点,但我将尝试从 github 上的源代码构建我自己的插件版本。