gpt4 book ai didi

angularjs - Chrome 无法启动( Protractor 、Ubuntu、 headless )

转载 作者:行者123 更新时间:2023-12-04 18:38:03 25 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 13.10(Atlassian Bamboo)机器上 headless 运行带有 Protractor 的 Chrome,但 Protractor 似乎无法启动 Chrome。

我正在使用 ChromeDriver 2.14、Selenium 2.45、gulp-protractor 0.0.12( Protractor 1.0),这是我的输出:

[05:22:55] Starting 'e2e'...
Using ChromeDriver directly...
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.

/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113
var template = new Error(this.message);
^
UnknownError: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 3.11.0-17-generic x86_64)
at new bot.Error (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113:18)
at Object.bot.response.checkResponse (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
at /mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:152:24
at /mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)
at notify (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:465:12)
at notifyAll (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:442:7)
at resolve (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:420:7)
at fulfill (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:535:5)
at /mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
at Function.webdriver.WebDriver.createSession (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
at new Driver (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:477:36)
at Object.createDriver (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:453:10)
at DirectDriverProvider.getNewDriver (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/lib/driverProviders/direct.js:68:23)
at Runner.createBrowser (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:180:37)
at /mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:257:21
at _fulfilled (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/mnt/bamboo-ebs/bamboo-agent/build-dir/node_modules/gulp-protractor/node_modules/protractor/node_modules/q/q.js:826:30)
[launcher] Process exited with error code 1

对此表示赞赏:)

编辑:我的 Protractor 配置
exports.config = {
directConnect: true,

// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},

// seleniumAddress: 'http://0.0.0.0:4444',
// add proper version number
seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar',
specs: ['specs/e2e/dist/*.js'],

plugins: [{
path: 'aurelia.protractor.js'
}],


// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};

最佳答案

Protractor 的一个困难是它位于一个庞大而脆弱的技术堆栈的顶部,其中大多数组件对其他组件具有严格的版本依赖关系。我建议确保您使用所有组件的最新版本,并且当您找到适合您的配置时,停止升级。

我猜问题是您使用的 Protractor 1.0 带有更新版本的 selenium 和不兼容的 chrome 驱动程序版本。

所以:

  • Protractor 2.0 更新
  • 使用默认的 selenium 驱动程序(即删除 seleniumServerJar 行)
  • 运行 webdriver-manager update以确保最新的 chrome 驱动程序。
  • 关于angularjs - Chrome 无法启动( Protractor 、Ubuntu、 headless ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29982444/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com