element(by.id('username')).sendKeys('deepu');
this throws the following error in headless mode,
Failed: No element found using locator: By(css selector, *[id="username"])
this is running fine in normal mode.
My package.json
"dependencies": {
"jasmine": "2.4.1",
"typescript": "^2.1.6"
},
"devDependencies": {
"@types/jasmine": "2.5.51",
"@types/jasminewd2": "^2.0.0",
"chromedriver": "^2.34.1",
"protractor": "^5.2.2",
"protractor-jasmine2-html-reporter": "0.0.7",
"selenium-server-standalone-jar": "^3.8.1",
"ts-node": "^3.0.2"
}
Chrome version 63.0.3239.132 (Official Build) (64-bit)
Thanks in advance, Deepu.
UPDATE
The actual problem was in ignoring certificate errors in the headless Chrome.
I was able to run the tests fine, bypassing the untrusted certificate warning from browser, with Protractor and Firefox Quantum(57.0.4, 64-bit) headless, but had to run a standalone selenium, couldn't find anything similar to chromedriver
framework: 'jasmine',
capabilities: {
browserName: 'firefox',
acceptInsecureCerts: true,
'moz:firefoxOptions': {
args: [ "--headless" ]
}
},
specs: [ './specs/login.spec.js' ],
seleniumAddress: 'http://localhost:4444/wd/hub',