Maximize Browser Window with Chrome doesn't work as expected on OSX
See original GitHub issueMaximize Browser Window
keyword only maximizes browser window height or doesn’t even do that at all (looks like Chrome opens by default with max height). When setting window size with Set Window Size
keyword browser’s width and height changes correctly. So it looks like Maximize Browser Window
is partially or completely broken with Chrome on OSX.
OS: macOS Sierra Chrome 53 & chromedriver 2.24
robotframework==3.0 robotframework-selenium2library==1.8.0 selenium==2.53.6 (tested also with 3.0.1)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to fix Chrome browser problems on a Mac - Setapp
1. Clear the cache, cookies, and site data · Open Chrome > Preferences in the menu bar or just type chrome://settings as the...
Read more >How to have Chrome cover everything except the dock when ...
Hold the Option key at the same time you click on the Maximize button on Chrome. This will maximize the window while leaving...
Read more >Google Chrome Window Resize Not Working
With Chrome open, click View from the menu in the upper left corner of your Mac. Then see if it says Enter Full...
Read more >maximize method is not working. OS : MAC #2794 - GitHub
In Marionette the driver.manage().window().maximize() is working fine.
Read more >Unable to Maximize Chrome Window - Google Groups
Above doesn't work for MAC. Any idea how to maximize chrome on MAC ?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was facing the same issue specifically for mac. Following worked fine for me.
JavascriptExecutor jse = (JavascriptExecutor)driver; String screenWidth = jse.executeScript(“return screen.availWidth”).toString(); String screenHeight = jse.executeScript(“return screen.availHeight”).toString(); int intScreenWidth = Integer.parseInt(screenWidth); int intScreenHeight = Integer.parseInt(screenHeight); Dimension d = new Dimension(intScreenWidth, intScreenHeight);
driver.manage.window.setSize(d);
The root problem appears to be that maximize in Chromium is not maximize. https://bugs.chromium.org/p/chromium/issues/detail?id=14185 So even starting Chrome with
--start-maximized
doesn’t help. IfSet Window Size
is not an alternative for you, here is a workaround that runs Chrome full screen: