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 |5 Answers
Reset to default 11This 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
inpackage.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.
protractor-jasmine2-screenshot-reporter
(though I doubt it is relevant). Executednode_modules/.bin/webdriver-manager update
. And, it started to work after it. Weird. – alecxe Commented Jul 17, 2016 at 12:19