I use one instance of the browser. When I run multiple tests, during the first test the browser window is maximized. At the start of the second test, the browser window size changes to the default size. At the start of the third test, the window is maximized and at the start of the fourth test, window size changes to the default size...etc.

This occurred when using the latest version of WebDriver - GeckoDriver 0.18.0. With previous version of WebDriver, the browser window size has remained maximized during all tests.

And I use the latest version of web browser Firefox 55.0.3.

With browser Chrome or IE it works well.

All test scripts contains driver.Manage().Window.Maximize();

Any idea why this is happening?

And how to fix it?

  • This is a weird behavior. Can you add your code for better debugging? – demouser123 Sep 22 '17 at 17:43
  • Sometime it happens – iamsankalp89 Sep 26 '17 at 9:18

These kind of problems might arise when updating your Firefox version. If it worked well before the update then my suggestion would be to look for any updates for the GeckoDriver and download it.

Version 0.19 has been released, I recommend you update and try again


try this

var width_size = 1024;
var width_size = 786;
driver.manage().window().setSize(width_size , width_size );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.