Resize browser window

0 votes

As pointed out in previous post (Maximize browser window), some websites implemented responsive design. You might want to execute some tests in smaller browser windows. Selenium WebDriver gives the ability to resize the browser window.

  public void resizeWindow() {
    final FirefoxDriver driver = new FirefoxDriver();

    driver.manage().window().setSize(new Dimension(400, 750));


See here a list of viewport sizes:

Please follow and like us:
Maximize browser window