How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?

driver.Manage().Window.Maximize();

This works for IE and Firefox. Chrome does not work. There is a bug submitted for this on ChromeDriver project.

Meanwhile, the get around for the chrome is to implement what Joey V. and Coder323 suggested.

ChromeOptions options = new ChromeOptions();
options.addArgument("--start-maximized");
driver = new ChromeDriver(options);

Leave a Comment