Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

Maximize Firefox browser window using selenium webdriver


Maximize a browser window :
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();


The WebDriver class provides the window interface for setting up the browser window
size, state, and so on. When we call the maximize() method, the browser window will be
maximized from normal or minimized state.

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

 Customize browser window size:

 To Customize a browser window, we need to call the maximize() method  with definition Dimension in side the setSize method

 driver.manage().window().setSize(new Dimension(320, 480));

Post a Comment

0 Comments