Chromedriver --screenshot not working in headless mode?
The window-size
argument expects string format 800,600
, try this instead:
chromeOptions.addArguments("window-size=1980,960");
Also, you have a typo in your screenshot
argument:
chromeOptions.addArguments("screenshot");
Here's a great reference of all available Chromium command line switches:
https://peter.sh/experiments/chromium-command-line-switches/