How to set window size using Chrome options in Geb framework?

How to set window size using Chrome options in Geb framework ?

Hi Helen!

To set the window size using Chrome options in Geb framework, you need to add below commands in your test scripts.

ChromeOptions options = new ChromeOptions();
options.addArguments("window-size=750,450");

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(capabilities);