以下配置未在给定端口上启动服务器。它每次都通过量角器在自己的端口上启动服务器。
exports.config = {
allScriptsTimeout: 11000,
multiCapabilities: [ {
browserName: 'chrome',
shardTestFiles: true,
//seleniumAddress: 'http://localhost:4444/wd/hub',
seleniumServerJar: './node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.4.0.jar',
seleniumPort: 4455,
seleniumArgs: ['-browserTimeout=60']
}
]
}
输出:
[11:06:47] I/local - Starting selenium standalone server...
[11:06:48] I/local - Selenium standalone server started at http://127.0.0.1:60315/wd/hub
期望服务器在端口4455上启动。
答案 0 :(得分:0)
尝试以下代码:
seleniumServerJar: './node_modules/protractor/node_modules/webdriver-
manager/selenium/selenium-server-standalone-3.4.0.jar',
localSeleniumStandaloneOpts:{
port: 4455,
args:['-browserTimeout=60']
}
multiCapabilities: [ {
browserName: 'chrome',
shardTestFiles: true,
}
]}