E/launcher – 未知错误: Chrome 启动失败: 异常退出, Protractor

huangapple go评论64阅读模式
英文:

E/launcher - unknown error: Chrome failed to start: exited abnormally, Protractor

问题

我对Protractor和自动化测试都不太熟悉。我运行了我的conf.js文件,但是进程终止,并出现了与Chrome相关的错误。我尝试了所有可能的解决方案,从升级Chrome到59x版本到降级到2.37版本,还添加了一些额外的配置到conf.js文件中,但是仍然无法解决问题。请问有人可以帮助我解决这个问题吗?谢谢!

(请注意,这只是对您问题的翻译,不包括解决方案或其他额外内容。)

英文:

I am new to protractor ,as well as automation testing. I ran my conf.js file but the process terminate with below error related to chorme


error message


$$> protractor conf.js

[08:38:14] I/launcher - Running 1 instances of WebDriver
[08:38:14] I/direct - Using ChromeDriver directly...
**

> [08:39:14] E/launcher - unknown error: Chrome failed to start: exited
> abnormally (Driver info: chromedriver=2.37.544315
> (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux
> 3.10.0-1062.1.1.el7.x86_64 x86_64) [08:39:14] E/launcher - WebDriverError: unknown error: Chrome failed to start: exited
> abnormally (Driver info: chromedriver=2.37.544315
> (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux
> 3.10.0-1062.1.1.el7.x86_64 x86_64)

**
at Object.checkLegacyResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.createSession()
at Function.createSession (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/usr/lib/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15)
at Direct.getNewDriver (/usr/lib/node_modules/protractor/built/driverProviders/direct.js:77:33)
at Runner.createBrowser (/usr/lib/node_modules/protractor/built/runner.js:195:43)
at q.then.then (/usr/lib/node_modules/protractor/built/runner.js:339:29)
at _fulfilled (/usr/lib/node_modules/protractor/node_modules/q/q.js:834:54)
at /usr/lib/node_modules/protractor/node_modules/q/q.js:863:30
at Promise.promise.promiseDispatch (/usr/lib/node_modules/protractor/node_modules/q/q.js:796:13)
at /usr/lib/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/usr/lib/node_modules/protractor/node_modules/q/q.js:137:13)

> [08:39:14] E/launcher - Process exited with error code 199

I have tried all possible solutions ,

From upgrading chrome to 59x version to downgrading it to 2.37 version

adding extras like below to conf.js file

directConnect: true,
useAllAngular2AppRoots:true,

capabilities: {
browserName: 'chrome',
chromeOptions: {
'args':['--no-sandbox']
}

}


 conf.js

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

exports.config = {

  directConnect: true,
  framework: &#39;jasmine&#39;,
  //  seleniumAddress: &#39;http://localhost:4444/wd/hub&#39;,
  specs: [&#39;spec.js&#39;],
  capabilities: {
    browserName: &#39;chrome&#39;,
    chromeOptions: {
      &#39;args&#39;: [&#39;--no-sandbox&#39;]
    }
  },
  useAllAngular2AppRoots: true
}

<!-- end snippet -->

could someone please help me make this work.

Thank you
(new to post questions on stackoverflow as well :b)

答案1

得分: 1

以下是要翻译的内容:

"主要错误在于您的Chrome未能启动会话。如果下载的Chrome版本是最新的测试版,则会出现此问题。这是最新的Protractor软件包中的一个错误,正在为Protractor 6发布进行修复,以与Webdriver Manager向后兼容。为此,您需要修复ChromeDriver的版本。

您是如何运行Webdriver Manager更新的?不要使用全局安装的Protractor来运行测试,请使用Node模块中的Protractor。在使用Webdriver Manager更新时也要执行同样的操作。使用固定版本,如./node_modules/protractor/bin/webdriver-manager update --standalone --versions.standalone=3.8.0 --chrome --versions.chrome=78.0.3904.97,将其添加到package.json文件中的脚本中。

在配置文件中添加Jasmine选项:

jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 260000,
        isVerbose: true,
        includeStackTrace: true,
    }

我不认为后者会有所帮助,但请尝试使用修复版本更新Webdriver Manager,并告诉我进展如何。"

英文:

The main error here is that your chrome is failing to start a session. This happens if the chrome version being downloaded is the latest beta version. This is a bug in the latest protractor package which is being looked into for the protractor 6 release with backwards compatibility with webdriver-manager. For this you will have to fix the version of the chromedriver.

How are you running your webdriver manager update? Do not use the globally installed protractor to run your tests, use the protractor from node modules. Do the same thing when using webdriver manager update. Use a fix version like ./node_modules/protractor/bin/webdriver-manager update --standalone --versions.standalone=3.8.0 --chrome --versions.chrome=78.0.3904.97
Add this to your scripts in package.json.

Add jasmine options in your configuration file:

jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 260000,
        isVerbose: true,
        includeStackTrace: true,
    }

I don't think the latter would help but try updating the webdriver manager with the fix version and let me know how that goes.

huangapple
  • 本文由 发表于 2020年1月3日 17:10:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/59575758.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定