如何使用 RemoteWebDriver + WebDriverBackedSelenium 连接到当前网格(不是 Grid2)
如果我可以利用 RemoteWebDriver
+ WebDriverBackedSelenium
然后连接到现有的 selenium 网格(不是最近发布的 Grid 2),
我需要它能够提供向后兼容性在我们的框架中,以便我们的用户可以使用 Selenium2 库并且仍然可以在网格上工作。
以下是我尝试完成此操作的方法:
URL remoteAddress = new URL("http://mymachine:4444/");
//have tried using the below commented out lines as well, but in all cases I face errors.
//URL remoteAddress = new URL("http://mymachine:4444/grid/register");
//URL remoteAddress = new URL("http://mymachine:4444/wd/hub");
RemoteWebDriver driver = new RemoteWebDriver(remoteAddress, DesiredCapabilities.firefox());
Selenium selenium = new WebDriverBackedSelenium(driver, "http://www.google.com");
我在端口“4444”的“mymachine”上运行一个网格,并且它确实连接了 Firefox 远程控制。
当语句
RemoteWebDriver driver = new RemoteWebDriver(remoteAddress, DesiredCapabilities.firefox());
执行时,我会收到各种各样的错误。
只是想知道 Selenium2 是否确实通过使用 WebDriverBackedSelenium 提供与 Grid 1 的向后兼容性。
我正在使用 Selenium 2.03b 版本。
If I can make use of RemoteWebDriver
+ WebDriverBackedSelenium
and then connect to the existing selenium grid (Not Grid 2 that is recently released)
I need this to be able to provide backward compatibility in our framework, so that our users can make use of Selenium2 libraries and still work against the grid.
Following is how I am trying to get this done:
URL remoteAddress = new URL("http://mymachine:4444/");
//have tried using the below commented out lines as well, but in all cases I face errors.
//URL remoteAddress = new URL("http://mymachine:4444/grid/register");
//URL remoteAddress = new URL("http://mymachine:4444/wd/hub");
RemoteWebDriver driver = new RemoteWebDriver(remoteAddress, DesiredCapabilities.firefox());
Selenium selenium = new WebDriverBackedSelenium(driver, "http://www.google.com");
I have a Grid running on "mymachine" in port "4444" and it does have Firefox Remote Controls hooked on to it.
The moment the statement
RemoteWebDriver driver = new RemoteWebDriver(remoteAddress, DesiredCapabilities.firefox());
gets executed I get all sorts of errors.
Just wanted to know if Selenium2 does indeed provide backward compatibility to work with Grid 1, by making use of WebDriverBackedSelenium.
I am using Selenium 2.03b version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您也应该对网格使用相同的 Selenium 2.03b 版本。您可以手动更新
/vendor
文件夹中的 jar。You should use the same Selenium 2.03b version for grid too. You can manually update the jar in
/vendor
folder.