Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

launching Protractor fails and exited with error code #199"

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?

like image 960
Saravana Avatar asked Nov 11 '16 05:11

Saravana


4 Answers

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.

like image 142
Bijay Timilsina Avatar answered Oct 19 '22 05:10

Bijay Timilsina


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'
};
like image 28
Saravana Avatar answered Oct 19 '22 04:10

Saravana


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.

like image 2
savita sathe Avatar answered Oct 19 '22 06:10

savita sathe


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

like image 1
radio_head Avatar answered Oct 19 '22 06:10

radio_head