question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maximize Browser Window with Chrome doesn't work as expected on OSX

See original GitHub issue

Maximize 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:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ngoyalxcommented, Jul 31, 2017

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);

1reaction
kormbrek-rallycommented, Oct 18, 2016

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. If Set Window Size is not an alternative for you, here is a workaround that runs Chrome full screen:

    ${options}  Evaluate  sys.modules['selenium.webdriver'].ChromeOptions()  sys
    Call Method  ${options}  add_argument  --start-fullscreen
    Create WebDriver  Chrome  chrome_options=${options}
    Go To  https://stackoverflow.com
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found