私は一部のe2eテストで分度器を使用しようとしています。プロジェクトはyeoman-gulp-angularを使用して生成されており、いくつかの定義済みのテストタスク/ configがあります。私がタスクを実行しようとすると、セレンが開始してから、スタックトレースがいくつかのエラーを出力してから、セレンがシャットダウンします。設定に何か不足していますか?角型E2E - セレニウム/分度器構成のエラー
分度器設定
'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},"[email protected]":{"d":"/Applications/Firefox.app/Contents/Resources/browser/features/[email protected]","e":true,"v":"1.0.5","st":1486662567000},"[email protected]":{"d":"/Applications/Firefox.app/Contents/Resources/browser/features/[email protected]","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]
と表示されます。 node_modules/protractor/seleniumを見ると、chromedriver_2.12.zip
が表示されます。 inside node_modules/protractor/config.json chromedriverのwebdriverVersionsを2.12から2.27に変更しましたが、これは利用できません。 protractor /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 filename
STACKTRACE
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)
ありがとうございます!これでChromeの問題は修正されましたが、今はFirefoxの接続エラーが表示され、分度器のconfファイルに定義されているFirefoxがありません。私が読んだことから、セレンと最新のファイアフォックスの問題と思われます。質問は私が設定ファイルに渡していないときにfirefoxが呼び出される理由です。上記の編集を参照してください。 – neridaj