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?
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.
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'
};
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With