[英]Using Selenium Grid to run IE tests from a linux hub
At work, we have some Selenium tests built to help test a website we are building. 在工作中,我们构建了一些Selenium测试来帮助测试我们正在构建的网站。 We need to support Firefox, Chrome and IE (both 10 and 11), and therefore the tests must run on all these browsers.
我们需要支持Firefox,Chrome和IE(两者均为10和11),因此测试必须在所有这些浏览器上运行。 We are working on setting up Selenium grid, with the hub on a linux (xubuntu to be specific) machine.
我们正在使用Linux(特别是xubuntu)计算机上的集线器来设置Selenium网格。 However, getting the hub to run tests on our windows VM (on an external machine) is proving troublesome.
但是,让中心在我们的Windows VM(外部计算机)上运行测试变得很麻烦。
We keep getting this error: 我们不断收到此错误:
The path to the driver executable must be set by the webdriver.ie.driver system property;
驱动程序可执行文件的路径必须由webdriver.ie.driver系统属性设置; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver .
有关更多信息,请参见http://code.google.com/p/selenium/wiki/InternetExplorerDriver 。
We have repeatedly tried adding the IEDriverServer to the webdriver.ie.driver property on both the linux machine and the windows VM using the following code to no avail: 我们反复尝试使用以下代码将IEDriverServer添加到linux计算机和Windows VM上的webdriver.ie.driver属性中,但无济于事:
System.setProperty("webdriver.ie.driver", details[1]);
DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
Where details[1] is the path of the IEDriverServer. 其中details [1]是IEDriverServer的路径。 We have tried using the path on both the Linux and the Windows.
我们已经尝试在Linux和Windows上使用该路径。
Is there any way to do this? 有什么办法吗? Or are we pretty much stuck running the hub on the windows VM (which we would rather not do)?
还是我们几乎停滞在Windows VM上运行集线器(我们宁愿不这样做)?
So after 4 hours we got it working. 因此,在4个小时后,我们开始工作了。
You have to include the IE driver, as well as the selenium-server-standalone-1.45.0.jar in the Windows PATH environment variable, and not include the "System.setProperty("webdriver.ie.driver", details[1]);" 您必须在Windows PATH环境变量中包括IE驱动程序以及selenium-server-standalone-1.45.0.jar,并且不包括“ System.setProperty(“ webdriver.ie.driver”),details [1 ]);” line in the test running on the linux machine, else it gets confused.
在linux机器上运行的测试中排成一行,否则会感到困惑。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.