Saturday, March 3, 2018

How to maximize the browser window in Selenium WebDriver

In this post, we will discuss How to maximize the browser window in Selenium WebDriver. When we launch a browser using Selenium WebDriver, by default it is not in its maximized state. Here, we will see how to maximize a browser using automation script.

NOTE : It is a good practice to maximize a browser after launch.Code Snippet to maximize the browser window :

//Maximize the Browser
driver.manage().window().maximize();

Maxmize a browser

Lets see the complete example to set the browser in maximize mode just after launch.

This is all about Maximizing the browser window. Hope you like this simple example. Thank you for reading this article, and if you have any problem, have a another better useful solution about this article, please write message in the comment section.