Selenium: maximize method is not working. OS : MAC

Created on 19 Sep 2016  路  9Comments  路  Source: SeleniumHQ/selenium

Meta -

OS: MAC OSX
Selenium Version:
selenium : selenium-java-3.0.0-beta3
Browser:
All browsers(Except Marionette)
Inches : 15

Expected Behavior - driver.manage().window().maximize should maximize the browser window.

As a workaround I am using

public static void maximizeScreen(WebDriver driver) {
java.awt.Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Point position = new Point(0, 0);
driver.manage().window().setPosition(position);
Dimension maximizedScreenSize =
new Dimension((int) screenSize.getWidth(), (int) screenSize.getHeight());
driver.manage().window().setSize(maximizedScreenSize);
}

Actual Behavior - driver.manage().window().maximize() is not working.

Most helpful comment

Hello guys even i have faced the same issue and I resolved it. I'm using MAC AIR for the automation of java scripts , its perfectly working fine on safari and having issue with chrome and firefox. I have tried with
driver.manage().window().maximize(); but its not working ...Then i tried with driver.manage().window().Fullscreen(); it works ..Cheers happy coding guys

All 9 comments

Please upgrade to the latest code, 2.51 is quite old. Also, are you saying that its working in Marionette and not in others or the other way around.

@AutomatedTester : it is not working even in selenium 3.0. Sorry my details aren't correct. Updated.
In Marionette the driver.manage().window().maximize() is working fine.

we don't track "all browsers" issues here.

Chromedriver has the bug already logged:
https://bugs.chromium.org/p/chromedriver/issues/detail?id=985

Firefox (with marionette) appears to work correctly.

SafariDriver issues should be logged with apple.

If there's an issue with the old FirefoxDriver, we are not likely to fix it since it no longer works with Firefox 48+

@lukeis since we are talking about OSX, after the osx update to mac os sierra my tests are running very slowly. I am using ThreadLocal, is it because of that. The same tests were running really fast when my osx was El capitan.
Here is the project link https://github.com/hemanthsridhar/CucumberJVM-Junit-TestSetUp
mvn clean test -Dbrowser=chrome -Durl=hubURL -DapplicationURL=http://etnabeta.cimm2.com

Or are your tests running slow as well?

The tests run smooth and fast in windows

Please look into it whenever you have time.

I have same problem, @lukeis is right, as so far no one would like to solve this problem. Wash wash sleep, haha!

Hello guys even i have faced the same issue and I resolved it. I'm using MAC AIR for the automation of java scripts , its perfectly working fine on safari and having issue with chrome and firefox. I have tried with
driver.manage().window().maximize(); but its not working ...Then i tried with driver.manage().window().Fullscreen(); it works ..Cheers happy coding guys

@shaikAltafas400 Google Chrome Drive 2.23 is good, thanks.

@shaikAltafas400 when 'm use driver.manage().window().Fullscreen(); the test goes ignored and says... org.openqa.selenium.WebDriverException: unimplemented command: session/16b2fb20a8187f8d050a165bc5126ded/window/fullscreen
Command duration or timeout: 46 milliseconds

driver.manage().window().Fullscreen(); works for me on MAC chrome

Was this page helpful?
0 / 5 - 0 ratings