I creating selenium scripts for mobile devices. Our site shows responsiveness based on screen size. I want to develop my script on desktop browser first. I need to resize browser window to get responsive design. How do I resize my browser window?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

answered by (171 points)
selected by
0 votes
Best answer

You can get a reference to the current window with driver.manage().window(). And the window has a setSize() method, so you could try

Dimension dimension = new Dimension(800, 600);