launching Protractor fails and exited with error code #199"
Asked Answered
P

10

7

I am a new Protractor. I am trying to run a sample unit test on my first Angular2 application.

my conf.js file has :

exports.config = { 
    seleniumAddress: 'http://localhost:3000/login', 
    specs: ['todo-spec.js'], 
    capabilities: { 
       'browserName': 'chrome', 
        chromeOnly:true , 
        directConnect: true } 
    };

2.my 'todo-spec.js' file has :

describe('Authentication capabilities', function() {
  var email = element(by.id('inputusername'));
  var password = element(by.id('inputPassword'));
  var loginButton = element(by.class('btn-success'));


it('should redirect to the login page if trying to load protected page while not authenticated', function() {
    browser.get('http://localhost:3000/login');
    loginURL = browser.getCurrentUrl();
    email.sendKeys("demo");
    password.sendKeys("demo");
    loginButton.click();

  });  
 });

but when i try to run the protractor by the following command "protractor "filepath\conf.js",

Getting " E/launcher - Process exited with error code 199" error.

can anyone please let me know, where I'm doing mistake?

Pooch answered 11/11, 2016 at 5:59 Comment(1)
could you pls elaborate where i have done mistake?Pooch
P
2

I fixed it by adding useAllAngular2AppRoots: true, in my config file.

also, commented "seleniumAddress: 'http://localhost:4444/wd/hub"

so right now my code is like this,and working.

exports.config = {
//seleniumAddress: 'http://localhost:4444/wd/hub',
//directConnect: true,
specs: ['todo-spec.js'],

capabilities: {
    'browserName': 'chrome',

},
useAllAngular2AppRoots: true,
framework: 'jasmine'
};
Pooch answered 14/11, 2016 at 9:36 Comment(3)
how are you able to connect with the browser without using seleniumAddress and directConnect?Chud
i think when i run protractor 'path\conf.js' it automatically starts selenium standalone server and starts the browser as well, once the test is done, it shuts down selenium server. :)Pooch
Add useAllAngular2AppRoots: true works for me. Thanks. But I need keep "seleniumAddress: 'localhost:4444/wd/hub"Slover
A
3

Check if you have the latest JDK and JRE are installed (Selenium somewhat seems to have dependencies with them).This was something unexpected that I found the hard way after finding that the server was not being initialised while running Protractor test tasks with gulp.

Abatement answered 13/6, 2017 at 16:33 Comment(1)
Thanks! This helped me a lot. Installing the Java Runtime solved the issue for me.Graeae
P
2

I fixed it by adding useAllAngular2AppRoots: true, in my config file.

also, commented "seleniumAddress: 'http://localhost:4444/wd/hub"

so right now my code is like this,and working.

exports.config = {
//seleniumAddress: 'http://localhost:4444/wd/hub',
//directConnect: true,
specs: ['todo-spec.js'],

capabilities: {
    'browserName': 'chrome',

},
useAllAngular2AppRoots: true,
framework: 'jasmine'
};
Pooch answered 14/11, 2016 at 9:36 Comment(3)
how are you able to connect with the browser without using seleniumAddress and directConnect?Chud
i think when i run protractor 'path\conf.js' it automatically starts selenium standalone server and starts the browser as well, once the test is done, it shuts down selenium server. :)Pooch
Add useAllAngular2AppRoots: true works for me. Thanks. But I need keep "seleniumAddress: 'localhost:4444/wd/hub"Slover
J
2

I was also facing the same issue. Eventually, I got the solution after updating the chrome latest version. I was using the Chrome version 79.0 and I have updated it to the latest version 80.0.3987.87 (Official Build) (64-bit).

Just try updating the latest chrome version as it worked for me.

Jaborandi answered 5/2, 2020 at 12:37 Comment(0)
C
1
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
//directConnect: true,
specs: ['todo-spec.js'],
capabilities: {
    'browserName': 'chrome'
},

framework: 'jasmine'
};

if you want to use directConnect, uncomment it and comment the seleniumAddress

Chud answered 11/11, 2016 at 6:15 Comment(3)
I just tried this. but getting this error now - 'E/launcher - Process exited with error code 135'Pooch
@Sarav did you start the selenium server before executing the config file?Chud
Hey danny, yes its resolved, but I had to use "useAllAngular2AppRoots: true,"Pooch
N
1

Check that your browser has the latest version (in my case this error disappeared after Chrome become latest version)

Nadianadine answered 7/8, 2019 at 13:3 Comment(0)
I
1

you have to update your chromedriver. Might be that you're locked in an older version of webdriver-manager that doesn't download chromedriver 78 for you. Doing npm install -f protractor should help for that.

Irrationality answered 20/12, 2019 at 12:35 Comment(0)
E
1

I was also facing the same issue. Eventually, I got the solution after downgrading the node version to 11.15.0. I was using the node version 12.0.0.

Now i have 11.15.0 and protractor tests with chrome works perfectly fine.

Everyday answered 15/3, 2020 at 14:19 Comment(0)
N
0

If it was working earlier and not now (May be after PC reboot or restart) than just update the webdriver by command in terminal

webdriver-manager update

It should work fine.

Even if wont work, Uninstall and reinstall the browser. It should work.

Nab answered 18/11, 2021 at 10:15 Comment(0)
R
0

In my case, my chrome browser version is 96.0 something initially when I upgrade it to 97.0.4692.71 then the issue is resolved

Reasoning answered 7/1, 2022 at 6:42 Comment(0)
P
0

this happens when multiple user using same remote machine followed by same Selenium server. As the other person quits the server, then def u will get it.

To resolve this: change the Selenium server address from regular 4444 to 9999 or any

This will work

Photomultiplier answered 29/8, 2022 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.