I'm trying to resize browser window after launching with below javascript
driver.get(url);
driver.manage().window().setSize(1200,800);
However, I'm getting an error
'setSize is not a function\n'.
Could someone please help me in resolving the issue, I have tried reSizeTo() as well
I just found a solution for my question, below code works
driver.manage().window().setRect({width: 640, height: 480, x, y});
This function in 2022 :
var width = 800;
var height = 600;
driver.manage().window().setRect({x: 0, y: 0, width: width, height: height});
https://www.selenium.dev/documentation/webdriver/interactions/windows/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With