Headless Chrome causing tests to fail?
See original GitHub issueI have written a number of tests that successfully pass when running through the Chrome Driver normally, however if running with Headless Chrome, all of the tests fail. As they cannot find the element and instead timeout. I have tried passing the window-size argument, but that didn’t resolve the issue.
capabilities: [{
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--disable-gpu', '--window-size=1920,1080'],
}
}],
The error thrown by Jasmine…
An element could not be located on the page using the given search parameters.
- WebdriverIO version: 4.14.1
- Mode: WDIO Testrunner
- If WDIO Testrunner, running sync/async: sync
- Node.js version: v8.11.2
- NPM version: 5.6.0
- Browser name and version: Chrome 66
- Platform name and version: Windows 7
- Additional wdio packages used (if applicable): wdio-jasmine-framework
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
selenium tests fail against headless chrome - Stack Overflow
I am trying to get my selenium test automation to run against headless chrome so that I can move it to TeamCity. I...
Read more >Headless testing on Chrome browser fails few times for no ...
There are many things that could cause tests to fail in headless and pass in head mode. The most likely cause is timing....
Read more >What are the limitations of chrome headless browser?
While test case counts are persistently increased test cases are caused fatal memory exception in phantom JS. so finally we are jumped into...
Read more >Selenium Java Code Runs Test Successfully But Fails When ...
join with Github I have written a number of tests that successfully pass when running through the Chrome Driver normally however if running...
Read more >Flags don't work when running headless? - Google Groups
... some of my tests to fail. If I do: Capybara.register_driver :headless_chrome do |app| capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@CharuDattPimple without any logs it is impossible to say what is going wrong. From what I see you have invalid arguments.
I’d recommend to capture as much logs as possible, quite often at this point it is clear enough what went wrong. Also, running chrome in headless depends on the environment, are you running it in docker?
Here is my config:
Depending on the chromedriver version you are using, you should actually be specifying
goog:chromeOptionsinstead ofchromeOptions, but you should be able to drop the--before your args. Theses are for running the drive via the command line. Try something like: