'Java chromedriver flag "--force-dark-mode" not working
Hei there I have a small script that opens a website and captures an element by doing a screenshot. Now the probelm is even tho the website is supposed to be in darkmode it opens for a short amount of time in white mode and then the picture is already taken with white mode, which doesnt look as nice. Now I know of the force darkmode experimental feature which I know fixed this issue. How can I implement this in selenium with java and the chromedriver? This flag sadly didn't work..
options.addArguments("--start-maximized","--headless","--window-size=2560,1440", "--ignore-certificate-errors", "--disable-dev-shm-usage");
options.addArguments("--force-dark-mode");
WebDriver driver = new ChromeDriver(options);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|