最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - uncaughtException after a Protractor run - Stack Overflow

programmeradmin0浏览0评论

After upgrading to Protractor 4.0.0 and adjusting the config because of the breaking changes, we finally have our tests launching.

Now, the problem is that after a test run it fails with:

[09:52:22] E/launcher - "process.on('uncaughtException'" error, see launcher
[09:52:22] E/launcher - Process exited with error code 199

How to debug this problem and understand what is causing it?


Tried to run Protractor in "troubleshoot" mode:

$ protractor config/local.conf.js --troubleshoot

but got exactly the same output with no details about the error.

After upgrading to Protractor 4.0.0 and adjusting the config because of the breaking changes, we finally have our tests launching.

Now, the problem is that after a test run it fails with:

[09:52:22] E/launcher - "process.on('uncaughtException'" error, see launcher
[09:52:22] E/launcher - Process exited with error code 199

How to debug this problem and understand what is causing it?


Tried to run Protractor in "troubleshoot" mode:

$ protractor config/local.conf.js --troubleshoot

but got exactly the same output with no details about the error.

Share Improve this question edited Jul 15, 2016 at 14:34 alecxe asked Jul 15, 2016 at 13:57 alecxealecxe 474k126 gold badges1.1k silver badges1.2k bronze badges 5
  • I'm getting this exact same error, but only with firefox for what it's worth. After upgrading to 4.0.0, I ran protractor/bin/webdriver-manager update and got the latest chrome-driver and the launcher is working fine with chrome. I am running on a mac. – sporkthrower Commented Jul 15, 2016 at 22:12
  • try using elementor npm library. It is really helpful for creating protractor tests. – Dejan Toteff Commented Jul 16, 2016 at 12:47
  • Even I am getting this error after i upgraded to 4.0.0. – Ram Pasala Commented Jul 16, 2016 at 16:35
  • @alecxe did you raise this in protractor github forum? this seems to be an issue, I am getting this with both chrome & firefox. I did some research, it is a node event uncaught exception error. my understanding of nodejs is limited that is why I am unable to handle it. I found this stackoverflow.com/questions/4213351/… but not sure how to approach this problem! – Ram Pasala Commented Jul 17, 2016 at 8:21
  • @igniteram1 not yet, trying to gather more information and gain understanding of the problem. I've reinstalled everything from scratch, removed the protractor-jasmine2-screenshot-reporter (though I doubt it is relevant). Executed node_modules/.bin/webdriver-manager update. And, it started to work after it. Weird. – alecxe Commented Jul 17, 2016 at 12:19
Add a comment  | 

5 Answers 5

Reset to default 11

This is currently being fixed and there should be a hot fix out soon. The quick fix (before the hot fix is released) is to change the code in your node_modules or revert to 3.3.0.

Edit node_modules/protractor/built/launcher.js replace the uncaughtException at line 168 with:

    process.on('uncaughtException', function (e) {
    var errorCode = exitCodes_1.ErrorHandler.parseError(e);
    if (errorCode) {
        var protractorError = e;
        exitCodes_1.ProtractorError.log(logger, errorCode, protractorError.message, protractorError.stack);
        process.exit(errorCode);
    }
    else {
        logger.error(e.message);
        logger.error(e.stack);
        process.exit(exitCodes_1.ProtractorError.CODE);
    }
});

Upgrading to protractor 4.0.10 seems to solve it.

There were several fixes from 4.0.0 to 4.0.10 in the launcher. See changelog: https://github.com/angular/protractor/blob/master/CHANGELOG.md

Still not sure what was happening and what is the best way to debug problems like this, but here is what I've done to fix it:

  • removed node_modules completely
  • executed npm install (protractor is listed as ^4.0.0 in package.json)
  • executed node_modules/.bin/webdriver-manager update

And now it works, it does not throw the uncaughtException anymore.


I've also removed the protractor-jasmine2-screenshot-reporter, but I don't think it is relevant.

Also, we've been using grunt-protractor-runner to run Protractor tests from a grunt task and I had to fork it and update protractor dependency to 4.0.0.

Solution for modify node_modules/protractor/built/launcher.js works.

There might be a error saying "E/launcher - unknown error: Chrome version must be >= 53.0.2785.0" which just need to update your chrome version

I've been using grunt-protractor-runner 4.0.0. I was testing specific test files and received this error after I noticed that I accidentally commented out all the files in the specs array in my protractor.conf.js file.

specs:
[
  //'test1-spec.js',
  //'test2-spec.js'
]

Hopefully this silly mistake helps someone.

发布评论

评论列表(0)

  1. 暂无评论