Hi TeamÂ
Need Help in running protractor tests with headless chrome. element not found issue
currently i am smoothly run my protractor test without headless chrome so i tried out headless in with i am getting element not found error
here is my config file setting
/Start- summary report/
var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
var reporter = new HtmlScreenshotReporter({
dest: 'summary/',
filename: 'summary-report.html',
showSummary:true
});
/End- summary report/
exports.config = {
directConnect: true,
//rootElement: 'html',
capabilities: {
'browserName': 'chrome',
 'chromeOptions': {
  'args': [ "--headless"]
  //"--disable-gpu",Â
  //, "--window-size=800x600"
 }
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine2',
// Spec patterns are relative to the current working directory when
// protractor is called.
//specs: ['Test/testcases.js'],
specs: ['testcases.js'],
getPageTimeout: 180000,
allScriptsTimeout: 180000,
jasmineNodeOpts: {
defaultTimeoutInterval: 540000
},
/Start- summary report/
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
// Assign the test reporter to each running instance
onPrepare: function() {
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/',
takeScreenshots:false
}));
jasmine.getEnv().addReporter(reporter);
},
// Close the report after all tests finish
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
}
};
and my testcase.js is this
describe('login', function() {
  it('Should login and verify success', function() {
    browser.get('https://localhost:3000');
    helpers.waitForElement(element(
by.id('logIn')),5000);
    element(
by.id('logIn')).click();
    helpers.waitForElement(element(by.model('user.username')),5000).then(function(){
    element(by.model('user.username')).sendKeys(USERNAME).
      then(function(){
        helpers.waitForElement(element(by.model('user.password')),5000);
        element(by.model('user.password')).sendKeys(PASSWORD).
          then(function(){
            helpers.waitForElement(element(
by.id('tryLogin')),5000);
            element(
by.id('tryLogin')).click()
          });
        });
    });
  });
});
Thanks