Posted in Selenium

How To Resize Browser Window Using Selenium WebDriver?

To resize the browser window to particular dimensions, we use ‘Dimension’ class to resize the browser window.

//Create object of Dimensions class

        Dimension d = new Dimension(480,620);

        //Resize the current window to the given dimension

        driver.manage().window().setSize(d);