我试图使用量角器进行一些e2e测试,而且以前从未使用过它。该项目已经生成使用约曼-吞咽角和有一些预定义的测试任务/信任。当我试图执行任务时,我看到selenium已经启动,然后堆栈跟踪会在selenium关闭之前输出一些错误。配置中缺少什么东西吗?
量角器配置
'use strict';
var paths = require('./.yo-rc.json')['generator-gulp-angular'].props.paths;
// An example configuration file.
exports.config = {
// The address of a running selenium server.
//seleniumAddress: 'http://localhost:4444/wd/hub',
//seleniumServerJar: deprecated, this should be set on node_modules/protractor/config.json
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: [paths.e2e + '/**/*.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};Stacktrace
Starting selenium standalone server...
(node:23800) DeprecationWarning: util.puts is deprecated. Use console.log instead.
Selenium standalone server started at http://[IP]/wd/hub
Stacktrace:
UnknownError: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"23817.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=56.0.2924.87)
(Driver info: chromedriver=2.12.301326 (093c7e07b4a916b690e784b0374c7f618f1ea4be),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)
...
Stacktrace:
UnknownError: Error communicating with the remote browser. It may have died.
...
Finished in 4.84 seconds
2 tests, 4 assertions, 4 failures
Shutting down selenium standalone server.编辑
[launcher] Error: UnknownError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
xpi","e":true,"v":"1.7","st":1486662567000},"firefox@getpocket.com":{"d":"/Applications/Firefox.app/Contents/Resources/browser/features/firefox@getpocket.com.xpi","e":true,"v":"1.0.5","st":1486662567000},"webcompat@mozilla.org":{"d":"/Applications/Firefox.app/Contents/Resources/browser/features/webcompat@mozilla.org.xpi","e":true,"v":"1.0","st":1486662567000}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"/Applications/Firefox.app/Contents/Resources/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","e":true,"v":"51.0.1","st":1486662567000}}}更新
我以为东西是固定的,但它们不是。在运行webdriver-manager update和webdriver-manager status之后,我看到了chromedriver version available: 2.27 [last]。当我查看节点_模块/量角器/selenium时,我看到了chromedriver_2.12.zip。在node_modules/protractor/config.json中,我将chromedriver的webdriverVersions从2.12更改为2.27,这是不可用的。不确定我应该在量角器/config.json中指定哪个版本。
test-mbp:fota-admin-portal test$ gulp protractor:src
[11:48:17] Starting 'webdriver-update'...
selenium standalone is up to date.
Updating chromedriver
downloading https://chromedriver.storage.googleapis.com/2.27/chromedriver_mac32.zip...
Error: Got code 404 from https://chromedriver.storage.googleapis.com/2.27/chromedriver_mac32.zip
chromedriver_2.27.zip downloaded to /Users/test/project/node_modules/protractor/selenium/chromedriver_2.27.zip
/Users/test/project/node_modules/adm-zip/adm-zip.js:19
throw Utils.Errors.INVALID_FILENAME;
^
Invalid filenameStacktrace
Stacktrace:
UnknownError: unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"26574.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=56.0.2924.87)
(Driver info: chromedriver=2.12.301326 (093c7e07b4a916b690e784b0374c7f618f1ea4be),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)发布于 2017-02-09 06:58:57
您所拥有的chromedriver版本非常老,与最新的铬版- 56不兼容。
查看量角器ChangeLog以获得色度驱动器最新版本的详细信息。
运行webdriver-manager update以获得最新的驱动程序,这将解决问题
您还可以检查铬位的色度驱动程序与Chrome兼容性。
最新版本: ChromeDriver 2.27支持Chromev54-56这个版本修复了一个导致ChromeDriver在SharedWorkers页面上失败的错误。
发布于 2017-02-09 11:27:17
从命令提示符执行以下命令,从命令终端更新铬驱动程序。
“网络驱动程序-经理”
一旦铬驱动程序已经更新,您将能够运行的情况,没有任何问题。
注意-使用“webdriver状态”查看驱动程序的版本详细信息。
如果你有任何问题,请告诉我。
https://stackoverflow.com/questions/42126431
复制相似问题