Maximize or resize browser window
Selenium WebDriver makes it possible to resize and maximize a browser window during an automated test.
Below you'll find examples on how to:
Maximize a window
The example below shows how to maximize the window to the full screen resolution (you can change the screen resolution as well).
Maximizing a window will only work on desktop browsers, not on mobile.
Resize a window
The example below shows how to resize the current window.
If you specify a size larger than the current resolution, elements may appear off-screen.
Find out how to change the screen resolution.
Resizing a window will only work on desktop browsers, not on mobile.