New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 19 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2017

Show other hotlists

Hotlists containing this issue:

Sign in to add a comment

Issue 1901: Error maximizing window with Chrome v60.0.3112.78 on Debian Jessie

Reported by, Jul 27 2017

Issue description

Issue Description:
Using driver.manage().window().maximize() works fine with Chrome v59 on Debian Jessie (in a Docker container, not sure if this is relevant), but after upgrade to Chrome v60.0.3112.78 the following error is thrown:

WebDriverError: unknown error: failed to change window state to maximized, current state is normal

I've been told the issue cannot be reproduced on MacOS.

Here's the rest of the stack (from Protractor):

Steps to reproduce (if relevant, you MUST provide a simplified html page or
link to public site):

On Debian Jessie, attempt to maximize browser window using driver.manage().window().maximize()

-----Other helpful tips:
Here's the rest of the stack (from Protractor):

[chrome #01-1] WebDriverError: unknown error: failed to change window state to maximized, current state is normal
[chrome #01-1]   (Session info: chrome=60.0.3112.78)
[chrome #01-1]   (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 3.13.0-125-generic x86_64) (WARNING: The server did not provide any stacktrace information)
[chrome #01-1] Command duration or timeout: 113 milliseconds
[chrome #01-1] Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
[chrome #01-1] System info: host: '5af0a77096d5', ip: '', 'Linux', os.arch: 'amd64', os.version: '3.13.0-125-generic', java.version: '1.8.0_131'
[chrome #01-1] Driver info:
[chrome #01-1] Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8), userDataDir=/protractor/.org.chromium.Chromium.vhLfmh}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.78, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
[chrome #01-1] Session ID: 5074b1ea652da0a1170a808bf463fa8b
[chrome #01-1]     at WebDriverError (/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
[chrome #01-1]     at Object.checkLegacyResponse (/protractor/node_modules/selenium-webdriver/lib/error.js:505:15)
[chrome #01-1]     at parseHttpResponse (/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
[chrome #01-1]     at doSend.then.response (/protractor/node_modules/selenium-webdriver/lib/http.js:440:13)
[chrome #01-1]     at process._tickDomainCallback (internal/process/next_tick.js:129:7)
[chrome #01-1] From: Task: WebDriver.manage().window().maximize()
[chrome #01-1]     at schedule (/protractor/node_modules/selenium-webdriver/lib/webdriver.js:816:17)
[chrome #01-1]     at Window.maximize (/protractor/node_modules/selenium-webdriver/lib/webdriver.js:1597:25)
[chrome #01-1]     at exports.config.onPrepare (/protractor/conf.js:80:38)
[chrome #01-1]     at q_1.Promise (/protractor/node_modules/protractor/lib/util.ts:48:39)
[chrome #01-1]     at Function.promise (/protractor/node_modules/q/q.js:682:9)
[chrome #01-1]     at Object.runFilenameOrFn_ (/protractor/node_modules/protractor/lib/util.ts:39:10)
[chrome #01-1]     at plugins_.onPrepare.then (/protractor/node_modules/protractor/lib/runner.ts:103:21)
[chrome #01-1]     at _fulfilled (/protractor/node_modules/q/q.js:834:54)
[chrome #01-1]     at self.promiseDispatch.done (/protractor/node_modules/q/q.js:863:30)
[chrome #01-1]     at Promise.promise.promiseDispatch (/protractor/node_modules/q/q.js:796:13)
[chrome #01-1]     at /protractor/node_modules/q/q.js:556:49
[chrome #01-1]     at runSingle (/protractor/node_modules/q/q.js:137:13)
[chrome #01-1]     at flush (/protractor/node_modules/q/q.js:125:13)
[chrome #01-1]     at _combinedTickCallback (internal/process/next_tick.js:67:7)
[chrome #01-1]     at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Comment 1 by, Aug 1 2017

Project Member
Labels: Needs-Feedback
I tested the below code on Linux Ubuntu 14.04, Windows 7, Mac OS with Chromedriver 2.31 on Chrome v60.0.3112.78 but not able to reproduce the issue.

	    WebDriver driver= new ChromeDriver();

- Is this different from what you are trying?
- Does this issue occurs only on Debian Jessie platform ?
- Could you please chromedriver verbose log? You can find information on how to enable verbose logging here :

Comment 2 by, Aug 2 2017

I am also not able to reproduce on Mac OS or Windows.  Only Debian Jessie (inside a Docker container) so far.

I'm trying to find a way to grab chromedriver logs, but I am running through Protractor (using webdriver-manager) AND inside a Docker container, so I haven't been able to figure out a way to generate them so far.

Comment 3 by, Aug 2 2017

I found a way!  Attaching the log.
146 KB View Download

Comment 4 by, Aug 3 2017

For me this is happening also on the latest MacOSX.
First the windows is maximized then I would like to reduce the size by:
screenDimension = new Dimension(420, 1000);

org.openqa.selenium.WebDriverException: unknown error: failed to change window state to normal, current state is maximized

Comment 5 by, Aug 3 2017

The same issue for me.
configuration: Ubuntu 17.04, Selenium 3.4, chromedriver 2.30/2.31 (both affected), Chrome 60, Codeception AT framework 2.3.4.
I'm attaching chromedriver.log.
5.5 KB View Download

Comment 6 by, Aug 3 2017

Project Member
rdbaron@ ,  jaromir.obr@,
Thanks for the logs. Unfortunately, I do not have Debian Jessie and Ubuntu 17.04 machines. I will try to find one.,
What version of Chromedriver and Chrome browser are you using?
I tried the below code with Chromedriver 2.31 on Chrome browser v60.0.3112.78 and it works fine.
	    WebDriver driver= new ChromeDriver();
	    driver.manage().window().setSize(new Dimension(640,360);
If this does not match with your test, please provide reproducible test.

Comment 7 by, Aug 3 2017


If you are familiar with Docker, I used to reproduce the issue. (it is built on Debian Jessie)

This image actually ships with Chrome v59 which was nice because I was able to show that the test worked with that setup, and then failed once I upgraded it to v60

Comment 8 by, Aug 4 2017

Project Member
Labels: -Needs-Feedback
Jianzhou: This seems to be in your area. Could you please take a look? Thanks!

Comment 9 by, Aug 7 2017

Hi rdbaron@,

Would you mind helping me to debug the issue? I don't have the environment to reproduce the problem.

From the log you provided, chrome failed to maximize the window within 0.1s.
Would it be possible for you to check: under chrome v60, whether the window has eventually been maximized? Maybe it takes more than 0.1s to maximize the window under docker.

It would also be useful to test: under chrome v59, is the window actually maximized, even though there is no error message.  


Comment 10 by, Aug 8 2017

Hey jzfeng@

Happy to help however I can.

Your first question is hard to answer.  As soon as webdriver throws the error, the process terminates which kills the browser as well.

As for the second question, I have been running with this call for about a year and a half with many older versions of Chrome so I can confirm that the browser was actually getting maximized until the day I upgraded to v60.

Comment 11 by, Aug 9 2017

Thanks for the information!

Would it be possible for you to modify the testing code so that it can catch the error and sleep for a while?

Comment 12 by, Aug 9 2017

I am also able to reproduce this using Ubuntu 16.04 LTS running headlessly (using a virtual display [Xvfb]).

Tests have been running without issue for over 2 months using chromedriver v59, but give

unknown error: failed to change window state to maximized, current state is normal

now, after they started using chromedriver v60.

Comment 13 by, Aug 10 2017

Just wanted to confirm it on Ubuntu 14.04, google-chrome-stable build 60.0.3112.90 and driver 2.30 or 2.31. It will work locally but if run in headless mode on an agent, we also use Xvfb I recall, everything would fail if it attempts to maximize.

Temporally switched to manually enlarge window with webDriver.manage().window().setSize(maximizedScreenSize);

Comment 14 by, Aug 10 2017

It's also happening for me, only in headless mode.

Chromium(driver) 60.0.3112.78 with Ubuntu 17.04. Previous version was 59.0.3071.109.
Chromium(driver) 60.0.3112.90 with up-to date Arch (as of this morning). Previous version was 59.0.3071.115.

Comment 15 by, Aug 11 2017

Project Member
Labels: HeadlessChrome

Comment 16 by, Aug 12 2017

Xvfb doesn't support maximization.
In headless chrome, maximizing window would not change the window size, since it doesn't know the screen size. Using setSize to modify the window size instead.
However, it shouldn't return "failed to change window state to maximized, current state is normal" error message.

Comment 17 by, Aug 14 2017

Just wanted to confirm this.
Ubuntu 14.04.5 LTS - chromium-chromedriver 60.0.3112.78-0ubuntu0.14
Previous chromedriver version 59.0.3071.109-0ubuntu0.14.04.1188 worked fine.

Comment 18 by, Aug 21 2017

same for we, starting from chromedriver v2.30. Reproducible in v2.31 as well.
Probably root cause is #1114 or #1779 ?

Not reproducible in v2.29

OS: Windows 10, Ubuntu 16

The issue is with:

can be workaround by:
ChromeOptions options = new ChromeOptions();
WebDriver webDriver = new ChromeDriver(options);

Please fix! Thank you

Comment 19 by, Aug 22 2017

Oops, looks like it is an issue starting from WebDriver 3.
Almost the same happening with firefox when trying either to maximize or create driver instance.

Comment 20 by, Aug 30 2017

Same problem here when using latest

Comment 21 by, Aug 30 2017

Would it be possible for you to check: whether the window has eventually been maximized? Maybe adding some try and catch logic around the maximize window command?

Comment 22 by, Aug 30 2017

This code :
System.out.println("Before " + driver.manage().window().getSize());
driver.manage().window().setSize(new Dimension(1600, 800));
System.out.println("Before " + driver.manage().window().getSize());
         try {
         } catch (Exception e) {
System.out.println("After " + driver.manage().window().getSize());

Gives this result :

Aug 30, 2017 8:44:42 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Before (1050, 1000)
Before (1600, 800)
After (1600, 800)

So setSize works, maximise does nothing, but tests run afterwards, so its not crashed

Comment 23 by, Aug 30 2017

Added :
 try {
            } catch (InterruptedException e1) {
                // TODO Auto-generated catch block
after the maximise command, before reading the size.
Still reports the same size.

Comment 24 by, Aug 30 2017

How about adding a sleep, like 10 seconds before System.out.println("After " + driver.manage().window().getSize());
Does the result change?

Comment 25 by, Aug 30 2017

Same behaviour with 10s sleep

Comment 26 by, Aug 30 2017

Thanks! Looks like chrome can not make the window maximized for some reason. Are you using a X display, or xvfb?

Comment 27 by, Aug 30 2017

Using, which Im pretty sure is using xvfb inside

Comment 28 by, Aug 30 2017

OK. Then the problem is probably due to xvfb. It is a known issue for a long time, see

Though I don't know how to fix it. You may need to use the setSize method instead.

Comment 29 by, Aug 30 2017

But this code has worked for many years without crashing or throwing exceptions.
And others have the same issue with Chrome 62 on Windows

Comment 30 by, Aug 30 2017
Thanks for workaround. It works in Codeception framework ( when using this YML configuration:
        - WebDriver:
            browser: chrome
            window_size: maximize

Comment 31 by, Aug 30 2017

You're welcome!

To avoid this issue:
do not use: driver.manage().window().maximize() or similar, if possible
do not interact with browser window while webdriver is initializing or changing window size.
do not let _YOUR_OS_ windows managers to resize/maximize/etc browser window while webdriver is initializing, and don't do it by yourself.

following this points for more than a week and have no crashes.

Comment 32 by, Aug 31 2017

This issue was also being handled in regarding Electron on Windows 10 and Chrome on Linux. I'm copying here the procedure to reproduce the issue using docker selenium/standalone-chrome:

  docker run -v /dev/shm:/dev/shm --rm -p 4444:4444 -p 5900:5900 --name abc -e JAVA_OPTS='' selenium/standalone-chrome:3.5.2-antimony

  # On another shell
  from selenium import webdriver
  browser =  webdriver.Remote("", webdriver.DesiredCapabilities.CHROME)

The ChromeDriver verbose log follows attached.

Note that the problem doesn't occur with the debug image (selenium/standalone-chrome-debug:3.5.2-antimony).
16.8 KB View Download

Comment 33 by, Sep 22 2017

I also suffer from this problem when using XvFB.

Selenium: 3.4.0
Chrome: 61
Chromedriver: 2.32.

Comment 34 by, Oct 20 2017

Project Member
Status: WontFix (was: Unconfirmed)
Unfortunately we don't have any way to fix this issue. Please use setSize instead of maximize if you're affected by this issue. Sorry for the inconvenience.

Comment 35 by, Nov 27 2017

Chromer Driver: and Chrome: 62.0.3202.94 (Official Build) (64-bit)
Facing this issue with Maximize. Kindly help me resolve this issue.

Comment 36 by, Nov 27 2017

Project Member
Re comment #35: This is caused by  issue #1918 . Please upgrade to ChromeDriver 2.33.

Comment 37 by, Nov 27 2017

Upgrading to ChromeDriver 2.33 doesn't help. I am still getting this error, intermittently. It happens once in a hundred times maybe, but you will run into it eventually.
Screen Shot 2017-11-27 at 1.16.48 PM.png
384 KB View Download

Comment 38 by, Nov 27 2017

Project Member
Re comment 37: Could you please open a new bug, and provide details of your test configuration, code you're running, and ChromeDriver log? Thanks.

Comment 39 by, Dec 12 2017

fyi, see this new issue I created which only reproduces with setWindowSize() only on certain resolutions on Mac, it also has chromedriver logs etc

Sign in to add a comment