I cannot get it to run without it opening a visible browser window. I tried both with "headless" and "--headless" arguments
Note: I am NOT using Selenium.
Acording to this page headless mode is supported in MacOSX since version 60. I'm running version 61
https://developers.google.com/web/updates/2017/04/headless-chrome
Here's my configuration:
"chrome" : {
"desiredCapabilities": {
"javascriptEnabled": true,
"acceptSslCerts": true,
"browserName": "chrome",
"chromeOptions" : {
"args" : ["--headless"],
"binary": "google-chrome"
}
}
},
I came across the same issue earlier and the solution was to add the following args as I don't want a sandbox neither need the gpu.
"args" : ["headless", "no-sandbox", "disable-gpu"]
"chrome" : {
"desiredCapabilities": {
"javascriptEnabled": true,
"acceptSslCerts": true,
"browserName": "chrome",
"chromeOptions" : {
"args" : ["headless", "no-sandbox", "disable-gpu"]
}
}
}
If you are on linux please try this, it works perfectly for me :
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions": {
"args": [
"headless", "disable-gpu"
],
"binary": "/usr/bin/google-chrome"
}
}
If you are on Mac, replace your binary path, eg /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
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