Subscribe Us

How To Maximize browser Window in Selenium Webdriver

.
Question : How To Maximize browser Window in Selenium Webdriver using Java ? 

Answer:
To maximize the browser window in selenium webdriver we use maximize() method.

maximize()
Maximize method is a predefined method in selenium webdriver which is used to maximize the browser window from default to full screen .

Syntax 
maximize();

Example 
driver.manage().window().maximize();


Selenium Code To maximize the window in Selenium webdriver 

package automation;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class MaximizeBrowser
 {
 public static void main(String[] args
{            System.setProperty("webdriver.chrome.driver","D:\\abc\\Soft\\chromedriver.exe");
WebDriver drivernew ChromeDriver();
driver.manage().window().maximize(); 
driver.navigate().to("https://google.com/");
driver.close();
}

}

In this tutorial we learn how to maximize Browser window in selenium webdriver .Hope this tutorial helpful for you 😊

Thanks & Regards 
Sandeep Yadav

Related Post :

  • How to refresh Webpage in selenium webdriver ?
  • How to click browser back button in selenium webdriver ?
  • How to click browser forward button in selenium webdriver ?
  • How to close browser window in selenium webdriver ?

Important Tags
how to maximize the window in selenium , how to maximize the browser window in selenium webdriver , maximizing browser window in selenium webdriver using java .


How To Maximize browser Window in Selenium Webdriver

Post a comment

0 Comments