我正在尝试在三个浏览器上并行运行一个量角器测试,即Internet Explorer,firefox&铬。随着时间的推移,我可能会添加更多的浏览器。
在任何情况下,我都可以使用此配置一次一个地运行测试
seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.53.1.jar';
seleniumArgs: '-Dwebdriver.chrome.driver=./node_modules/protractor/selenium/chromedriver_2.22.exe'
seleniumArgs: '-Dwebdriver.gecko.driver=./node_modules/protractor/selenium/geckodriver_v0.9.0.exe'
seleniumArgs: '-Dwebdriver.ie.driver=./node_modules/protractor/selenium/IEDriverServer_Win32_2.53.1.exe'
// Capabilities to be passed to the webdriver instance.
capabilities:
{
browserName: 'firefox',
ignoreProtectedModeSettings: true,
'pageLoadStrategy': 'eager',
'marionette': 'true',
},
即。我会根据我正在测试的浏览器在seleniumArg中发表评论,并且我会在功能和更新中更改browserName。评论木偶,如果我不使用Firefox。我通过环境变量有一个巧妙的方法,但这可以让我知道我是如何接近这个。
现在我想这样做并行,所以现在我有另一个配置文件,如此
seleniumAddress: 'http://localhost:4444/wd/hub',
multiCapabilities:
[
{
browserName: 'firefox',
pageLoadingStrategy: 'eager',
ignoreProtectedModeSettings: true,
marionette: true,
},
{
browserName: 'chrome',
pageLoadingStrategy: 'eager',
ignoreProtectedModeSettings: true
},
{
browserName: 'internet explorer',
IntroduceInstabilityByIgnoringProtectedModeSettings: true,
ignoreProtectedModeSettings: true
}
],
但是无论何时我运行此配置,所有浏览器实例都会抛出错误,说明找不到驱动程序可执行文件
[internet explorer #21] WebDriverError: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information
[firefox #01] WebDriverError: The path to the driver executable must be set by the webdriver.gecko.driver system property;
[chrome #11] WebDriverError: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information,
在运行配置文件之前,我执行webdriver-manager start
所以我想问题是如何在multiCapabilities对象中知道驱动程序路径?或者这是使用量角器运行并行测试的建议方法,即连接到某个硒地址?非常感谢任何人提供的任何信息。
我的config.json看起来像这个btw,如果它有任何区别
{
"webdriverVersions":
{
"selenium": "2.53.1",
"chromedriver": "2.22",
"iedriver": "2.53.1"
}
}