我尝试在Windows 7 x64上使用量角器运行一些测试,但得到以下错误:
[16:59:18] E/direct - Error code: 135 [16:59:18] E/direct - Error message: browserName 'chrome' is not supported with directConnect. [16:59:18] E/direct - Error: browserName 'chrome' is not supported with directConnect. at IError (C:\Work\GIT\pv-ui\node_modules\protractor\built\exitCodes.js:6:1) at ProtractorError (C:\Work\GIT\pv-ui\node_modules\protractor\built\exitCodes.js:11:9) at BrowserError (C:\Work\GIT\pv-ui\node_modules\protractor\built\exitCodes.js:52:9) at Direct.setupDriverEnv (C:\Work\GIT\pv-ui\node_modules\protractor\built\driverProviders\direct.js:36:23) at Direct.setupEnv (C:\Work\GIT\pv-ui\node_modules\protractor\built\driverProviders\driverProvider.js:111:34) at q.then (C:\Work\GIT\pv-ui\node_modules\protractor\built\runner.js:335:41) at _fulfilled (C:\Work\GIT\pv-ui\node_modules\q\q.js:834:54) at self.promiseDispatch.done (C:\Work\GIT\pv-ui\node_modules\q\q.js:863:30) at Promise.promise.promiseDispatch (C:\Work\GIT\pv-ui\node_modules\q\q.js:796:13) at C:\Work\GIT\pv-ui\node_modules\q\q.js:857:14 at runSingle (C:\Work\GIT\pv-ui\node_modules\q\q.js:137:13) at flush (C:\Work\GIT\pv-ui\node_modules\q\q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9) at Module.runMain (module.js:606:11) at run (bootstrap_node.js:383:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:496:3 [16:59:18] E/launcher - Process exited with error code 135
节点版本:v6.11.5
量角器版本:5.2.0
以下是 protractor.conf.js 的一部分:
exports.config = {
// The address of a running selenium server.
// seleniumAddress: 'http://localhost:4444/wd/hub',
directConnect: true,
allScriptsTimeout:60000,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome',
chromeOptions: {
// disable "chrome is being controlled by automated software"
'args': ['disable-infobars=true'],
// 'args': ['--headless', '--disable-gpu', '--window-size=1400,3000', 'disable-infobars=true'],
// disable Password manager popup
'prefs': {`enter code here`
'credentials_enable_service': false
}
}
},
...
}
在MacOS上一切正常,但在Windows 7上失败了。你能帮我找出问题所在吗?
答案 0 :(得分:0)
请确保安装
npm install protractor
更新Web驱动程序管理器
webdriver-manager update
从根目录运行此命令
node node_modules\protractor\bin\webdriver-manager update
现在使用以下命令启动服务器:
webdriver-manager start
还要确保您的protractor.conf.js文件具有以下行
// baseUrl: 'http://localhost:4200/',
seleniumAddress: 'http://localhost:4444/wd/hub/',
现在在不同的浏览器上运行e2e测试
ng e2e