Reputation: 427
my problem is that Chrome won't start in fullscreen when it's in headless mode. Running code in C#, ChromeDriver version: 87.0.4280.8800
I've tried "everything".
When running in headless I can see of GetScreenshot that Chrome is in like mobile view. When running normally (not headless) Chrome starts fullscreen. I'm really stuck here.
public MyTestMethod() {
ChromeOptions options = new ChromeOptions();
options.AddArgument("--headless");
options.AddArgument("--start-maximized");
options.AddArguments("--test-type-auth-server-hitelist=*.myTestSite.test");
options.AddArguments("--ignore-certificate-errors");
options.AddArgument("--allow-insecure-localhost");
options.AddArgument("--disable-gpu");
options.AddArgument("--no-sandbox");
WebDriver = new ChromeDriver(options);
}
Upvotes: 2
Views: 575
Reputation: 427
Ok - this did the trick if anyone else encounter this problem:
enter code here
options.AddArgument("--window-size=1325x744");
Upvotes: 0