How to maximize Browser Window in Selenium using java
driver.manage().window().maximize();
Maximize() Method:
To maximize a browser window, we need to call the maximize() method of the Window interface of the driver class. Add the second line right below where you define an instance of FirefoxDriver.
To maximize a browser window, we need to call the maximize() method of the Window interface of the driver class. Add the second line right below where you define an instance of FirefoxDriver.
driver = new
FirefoxDriver();
driver.manage().window().maximize();
Selenium code for maximize the browser window
package New;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import
org.openqa.selenium.chrome.ChromeDriver;
public class AutomationTesting
{
{
public static void main(String[] args)
{ System.setProperty("webdriver.chrome.driver","D:\\Sandeep\\Soft\\chromedriver.exe");
WebDriver driver= new ChromeDriver();
driver.manage().window().maximize();
driver.manage().window().maximize();
driver.navigate().to("https://qaacharya.in/");
driver.close();
}
}
Hope!!! The above code " how to maximize the browser Window in selenium helpful for you ..
Team
QA acharya
Tags: how to maximize the browser window in selenium , how to maximize the browser window in selenium webdriver , How to maximize the window in selenium .
Related Post: