Selenium Java to maximize the browser window and get its properties
KW.java
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

class KW 
{
    public static void main(String[] args) 
    {
        System.setProperty("webdriver.chrome.driver", "/home/kodingwindow/drivers/chromedriver");
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();    //maximize the browser window
        //driver.manage().window().fullscreen();
        System.out.println(driver.manage().window().getSize());
        System.out.println(driver.manage().window().getPosition());
        driver.get("https://kodingwindow.com/testapp/");
        driver.close();
    }
}
Output
(1382, 744)
(-8, -8)
Advertisement