Solvedprotractor Protractor fails with error code 199 on WebDriver.createSession()

Hi guys. I am using angular-cli and protractor fails to run my tests. I am sitting behind a corporate proxy which I add as a param when updating the webdriver.
This is the output I get:

$ ./node_modules/.bin/webdriver-manager update --proxy=proxy_url_here
[15:11:28] I/update - selenium standalone: file exists C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.4.0.jar
[15:11:28] I/update - selenium standalone: selenium-server-standalone-3.4.0.jar up to date
[15:11:28] E/downloader - undefined
[15:11:28] I/update - geckodriver: file exists C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\node_modules\webdriver-manager\selenium\
[15:11:28] I/update - geckodriver: unzipping
(node:12156) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Invalid filename
[15:11:28] I/update - chromedriver: unzipping

$ ./node_modules/.bin/protractor ./protractor.conf.js
[15:26:13] I/launcher - Running 1 instances of WebDriver
[15:26:13] I/direct - Using ChromeDriver directly...
[15:26:15] E/launcher - spawn UNKNOWN
[15:26:15] E/launcher - Error: spawn UNKNOWN
    at exports._errnoException (util.js:1022:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at Object.exports.spawn (child_process.js:380:9)
    at exec (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\selenium-webdriver\io\exec.js:116:27)
    at resolveCommandLineFlags.then.args (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\selenium-webdriver\remote\index.js:219:25)
    at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
    at Function.createSession (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\selenium-webdriver\lib\webdriver.js:777:24)
    at Function.createSession (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\selenium-webdriver\chrome.js:709:29)
    at Direct.getNewDriver (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\lib\driverProviders\direct.ts:90:25)
    at Runner.createBrowser (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\lib\runner.ts:225:39)
    at q.then.then (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\lib\runner.ts:391:27)
    at _fulfilled (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\node_modules\q\q.js:834:54)
    at self.promiseDispatch.done (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\node_modules\q\q.js:796:13)
    at C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\node_modules\q\q.js:556:49
    at runSingle (C:\Users\g8uibf\Projects\mbsportal-ui\node_modules\protractor\node_modules\q\q.js:137:13)
[15:26:15] E/launcher - Process exited with error code 199
  • Node Version: v6.9.5
  • Protractor Version: 5.1.2
  • Angular Version: 4
  • Browser(s): chrome 58
  • Operating System and Version Windows 10
  • Your protractor configuration file
const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
  capabilities: {
    'browserName': 'chrome'
  directConnect: true,
  baseUrl: 'http://localhost:8080/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  onPrepare() {
      project: 'e2e/tsconfig.e2e.json'
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));

Thank you for the help in advance!

42 Answers

✔️Accepted Answer

For those still have this issue, after checking the official FAQ, I fixed the issue by adding the flag --no-sandbox for Chrome 66.

Other Answers:

@amit-kumar88 In your protractor.conf.js:

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

Hi Team, Even i am facing the issue
webdriver-manager status
[14:56:47] I/status - selenium standalone version available: 3.141.59 [last]
[14:56:47] I/status - chromedriver version available: 87.0.4280.88 [last]
[14:56:47] I/status - geckodriver version available: v0.28.0 [last]
[14:56:47] I/status - android-sdk is not present
[14:56:47] I/status - appium is not present

[14:55:30] I/launcher - Running 1 instances of WebDriver
[14:55:30] I/direct - Using ChromeDriver directly...
[14:55:30] E/launcher - spawn Unknown system error -86
[14:55:30] E/launcher - Error: spawn Unknown system error -86
    at ChildProcess.spawn (internal/child_process.js:366:11)
    at Object.spawn (child_process.js:551:9)
    at exec (/Users/naveensabares/ctp-mobile/node_modules/selenium-webdriver/io/exec.js:116:27)
    at resolveCommandLineFlags.then.args (/Users/naveensabares/ctp-mobile/node_modules/selenium-webdriver/remote/index.js:219:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.createSession()
    at Function.createSession (/Users/naveensabares/ctp-mobile/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/Users/naveensabares/ctp-mobile/node_modules/selenium-webdriver/chrome.js:761:15)
    at Direct.getNewDriver (/Users/naveensabares/ctp-mobile/node_modules/protractor/built/driverProviders/direct.js:77:33)
    at Runner.createBrowser (/Users/naveensabares/ctp-mobile/node_modules/protractor/built/runner.js:195:43)
    at q.then.then (/Users/naveensabares/ctp-mobile/node_modules/protractor/built/runner.js:339:29)
    at _fulfilled (/Users/naveensabares/ctp-mobile/node_modules/protractor/node_modules/q/q.js:834:54)
    at /Users/naveensabares/ctp-mobile/node_modules/protractor/node_modules/q/q.js:863:30
    at Promise.promise.promiseDispatch (/Users/naveensabares/ctp-mobile/node_modules/protractor/node_modules/q/q.js:796:13)
    at /Users/naveensabares/ctp-mobile/node_modules/protractor/node_modules/q/q.js:556:49
    at runSingle (/Users/naveensabares/ctp-mobile/node_modules/protractor/node_modules/q/q.js:137:13)
[14:55:30] E/launcher - Process exited with error code 199

Process finished with exit code 199

Related Issues:

protractor TS2440: Import declaration conflicts with local declaration of 'PluginConfig'.
May not be the best solution for everyone but you should be able to fix this by adding the following...
protractor Protractor tests fail on chrome v56 & v57 - chrome not reachable
UPDATE: Got it to work! According to ...
protractor Protractor fails with error code 199 on WebDriver.createSession()
For those still have this issue after checking the official FAQ I fixed the issue by adding the flag...
protractor Protractor 5.1.1 doesn't work with Chrome 57
@qualityshepherd To get rid of the password prompts (in a node.js client - please translate for your...
components Error: mat-form-field must contain a MatFormFieldControl.
You have to add to app.module.ts: Bug feature request or proposal: When doing a karma/jasmine test I...
angular Angular5.x lazyLoad problem, undefined is not a function
For others that find this issue via Google as i did: I had the same problem when trying to lazy load...
angular Cyclic dependency error with HttpInterceptor
I resolved simply not setting authService in constructor but getting in the intercept function. ...
angular cli Issue: Cannot read property 'thisCompilation' of undefined
Here is the answer from issues #9793 : npm remove webpack npm install webpack@3.11.0 ...
angular Uncaught Error: Can't resolve all parameters for ...
You are missing an @Injectable() annotation on your ApiService Support requests like these should li...
ngx bootstrap fix(tooltip): tooltip flickering when hover the mouse on the border on the tooltip position
Add pointer-events: none; to the tooltip css problem solved! .tooltip { pointer-events: none; } ...
angular Force reload/refresh current route with RouteReuseStrategy
Hi If you really need to trick the Router into reloading the component on each routerLink click ...
angular Misleading error message "Cannot find a differ supporting object '[object Object]'"
I just ran into the same issue I'm not sure if the recommended solution will work for my case ...
angular cli Error | Could not find plugin "proposal-numeric-separator" | Generating ES5 bundles for differential loading
Try to install @babel/compat-data: ~7.8.0 to devDependencies This is the only workaround which helpe...
angularfire Missing exported members after updating to Angular 6.0.0
It looks like rxjs-compat is missing Use npm i rxjs-compat to install the missing rxjs-compat. ...
sheetjs How to simply export a Worksheet to xlsx?
There are two issues: each object is mapped to a row so if you want a row with name John and city Se...
angular cli Using invalid environment causes error in build (was "ERROR in Cannot read property 'length' of undefined")
Probably not the same cause but we had the same error (Cannot read property 'length' of undefined) w...
angular cli ng serve method ip not open in another machines
The solution is simple Just bind to the correct interface address via ng serve --host= ...
angular cli Incorrect JS paths when ng build -prod is deployed in a subfolder
When you're deploying to non-root path within a domain you'll need to manually update the <base href...
angular update 2 to 4 has problem [ts] Property 'map' does not exist on type 'Observable<Response>'.
I met the same problem with the angular cli 6.0.0 and rxjs 6.1.0 And I solved the problem by replaci...
angular cli Installation error: permission denied for node-sas
sudo npm install -g --unsafe-perm --verbose @angular/cli Installation error (node-sass) with: node v...
angular cli ng build -prod Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
Instead of use ng build --prod use ng build --env=prod UPDATE As many of us (thx) have mention this ...
angularfire ERROR TypeError: Object(…) is not a function” using AngularFirestore and firebase
@jamesdaniels Yes npm install rxjs@6 rxjs-compat@6 --save It solved the issue. I want to use firebas...
storybook Webpack 4 support?
I'm getting the below error when running Storybook with a project using Webpack 4; This is preventin...
angular cli Property 'controls' does not exist on type 'AbstractControl'.
Got it! Looked at the docs - FormArray The FormArray class contains the controls property ...
angular Angular2 AoT Compiler Errors
pls try /cc @chuckjaz When I try to compile my project with ngc it throws the below error: Error: Er...
angular cli [Bug] cli needs to be reloaded when a lazy loaded module is added in routes (FIXED)
I recomended change { path: 'user-panel' loadChildren: './user-panel/user-panel.module#UserPanelModu...
prettier Change HTML/JSX formatting to have one attribute/prop per line
The point I am trying to make is that the vertical space matters Wasting it (too much) has negative ...
angularfire @firebase/firestore: Firestore (5.8.0): timestampsInSnapshots
eg: app.module.ts Version info Angular: 7.2.1 Firebase: 5.8.0 AngularFire: 5.1.1 In the newest fireb...
angular cli AOT build fails
I noticed same problem and after npm i enhanced-resolve@3.3.0 I can build with AOT ...
angular cli Cannot find name 'require'. using relative paths...
Ahhh here we go try adding declare var require: any; To src/typings.d.ts I am using a config with re...
components [Table] Add example with dynamic columns
For those interested Bug feature request ...
angular starter How to include Twitter Bootstrap 3 using webpack
I just tested it now Hi I have taken a look at #214 & #215 but these don't really explain how to set...
angular HttpClient.delete() cannot handle a body in its request
It would be great to have body param in .delete() We just migrated our project to HttpClient and for...
ng bootstrap No provider for NgbActiveModal! => "Components as content"
try to provide NgbActiveModal on app.module Bug description: When trying to implement the Modal usin...
angular cli "No NgModule metadata found for 'AppModule'" after Upgrade to Angular 5.1.0 and AngularCli 1.6.0
I got the same error The issue is fixed only when i manually re installed angular/cli The webpack sh...
angularfire 5.2.1 AngularFireAuthGuard causes TypeError: source.lift is not a function
I worked in this way Performing basic docs for AngularFireAuthGuard produces an error related to sou...
angular cli ng serve doesn't listen other than localhost
Works with command ng serve --host OS? Windows 7 8 or 10 Linux (which distribution) Mac OSX ...
angular Http - Observable completed function not firing
Third callback haven't been called when error occures ES6 promises hasn't method finally only then a...
angular Using multiple components in different modules causing "Type X is part of the declarations of 2 modules" error
as @brandonroberts saids create a shared module like this: then use the SharedModule like this.. ...
core How to unit test a component with TranslateService and the translate pipe?
I'm just coming up to speed on this stack and was trying to wrap some tests around an Ionic componen...
angular cli ng: command not found
Removing NODE and using NVM instead fixed a lot of issues After installing angular-cli with the help...
angular cli ng build fails with error Cannot find module 'webpack/lib/node/NodeTemplatePlugin' after updating to v1.3.0
I faced this issue many times recently and always the fix worked for me is : Bug Report or Feature R...
angular cli -bash: ng: command not found
This was a pain to figure out Please provide us with the following information: OS? Mac OSX (Seirra)...
angular cli Uncaught TypeError: Cannot read property 'apply' of undefined on new install
Downgraded to zone.js@0.8.5 and the problem disappeared. Bug Report or Feature Request (mark with an...
angular cli I am on Angular 5 and CLI 1.5 and I get an error
I faced this error after updating a non-CLI project to Angular 5 and @ngtools/webpack 1.8.0 ...
ionic framework Bugs when run ionic cordova run ios --device or use --target options
Hi @fwagner thank you for the good news I already build and upload to production So the problem here...
core [Question] How to include html tags in your translation strings
If we do <p [innerHtml]={{ 'withSpan' | translate }}></p> we get an error: Parser Error: Got interpo...
angular starter Unit test error: Router outlet is not a known element
@eamell - I am still on rc6 and I changed my configuration to RouterTestingModule and it still works...