I'm using protractor for my e2e tests. Recently we updated to Chrome 71 and Webdriver 2.45 and now we constantly get the error: "chrome not reachable" when running headless.
If we do not run headless our tests pass. Because headless tests are more consistent en faster I still want to use headless mode.
On chrome 70 and webdriver 2.44 we had no problems at all.
args: [
'--disable-gpu',
'--disable-impl-side-painting',
'--disable-gpu-sandbox',
'--disable-accelerated-2d-canvas',
'--disable-accelerated-jpeg-decoding',
'--disable-popup-blocking',
'--no-sandbox',
'--test-type=ui',
'--start-maximized',
'--window-size=1800,1000',
'--headless'
]
WebDriverError: chrome not reachable (Session info: headless chrome=71.0.3578.80) (Driver info: chromedriver=2.45.615355 (d5698f682d8b2742017df6c81e0bd8e6a3063189),platform=Mac OS X 10.14.1 x86_64)
Any thoughts?
Headless Browser automation in protractor A headless browser is a browser simulation program that does not have a user interface (UI less). Headless browser programs operate like any other browser but do not display any UI. Protractor executes it's tests in the background.
We’ll use the existing protractor.conf.js to hold the common code that each browser will use. In order to run these default tests, new Edge and old Edge can actually just use the same config file.
We’ll adapt this setup so that it can run its Protractor E2E tests in Chrome, old Edge, and new Edge. Each browser requires some unique code, of course, but a lot of it can be consolidated into a shared file.
We can use headless testing once the cross-browser testing is completed and want to run regression test cases in subsequent releases and with continuous integration. You have no option other than using headless testing when your machine does not have a GUI, for instance, if you want to run your tests in Unix.
The cause in our case is most likely to be this bug in either ChromeDriver or Chrome headless:
Some of our tests trigger file downloads, and it appears that ChromeDriver or Chrome headless freezes from that point onward, responding to any further requests with "chrome not reachable".
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