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

Issue 1901 link

Starred by 19 users

Issue metadata

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


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

Error maximizing window with Chrome v60.0.3112.78 on Debian Jessie

Reported by rdba...@gmail.com, 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: '172.18.0.13', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-125-generic', java.version: '1.8.0_131'
[chrome #01-1] Driver info: org.openqa.selenium.chrome.ChromeDriver
[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)

 
Project Member

Comment 1 by gmanikpure@chromium.org, Aug 1 2017

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();
	    driver.manage().window().maximize();

- 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 : https://sites.google.com/a/chromium.org/chromedriver/logging

Comment 2 by rdba...@gmail.com, 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 rdba...@gmail.com, Aug 2 2017

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

Comment 4 by gang...@gmail.com, 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);
driver.manage().window().setSize(screenDimension);

Error:
org.openqa.selenium.WebDriverException: unknown error: failed to change window state to normal, current state is maximized
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.
chromedriver.log
5.5 KB View Download
Project Member

Comment 6 by gmanikpure@chromium.org, Aug 3 2017

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.

gangeld@gmail.com,
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().maximize();
	    driver.manage().window().setSize(new Dimension(640,360);
If this does not match with your test, please provide reproducible test.

Comment 7 by rdba...@gmail.com, Aug 3 2017

gmanikpure@

If you are familiar with Docker, I used https://hub.docker.com/r/robcherry/docker-chromedriver/ 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
Project Member

Comment 8 by johnchen@chromium.org, Aug 4 2017

Cc: johnchen@chromium.org jzfeng@chromium.org
Labels: -Needs-Feedback
Jianzhou: This seems to be in your area. Could you please take a look? Thanks!
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.  

Thanks!




Comment 10 by rdba...@gmail.com, 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.
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?
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.
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);
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.
Project Member

Comment 15 by gmanikpure@chromium.org, Aug 11 2017

Labels: HeadlessChrome
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 jsan...@gmail.com, 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 xle...@gmail.com, 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:
driver.manage().window().maximize();

can be workaround by:
ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");
WebDriver webDriver = new ChromeDriver(options);


Please fix! Thank you

Comment 19 by xle...@gmail.com, 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.
Same problem here when using latest
https://hub.docker.com/r/selenium/standalone-chrome/
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?
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 {
            driver.manage().window().maximize();
         } catch (Exception e) {
            System.out.println("tryn");
         }
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)
tryn
After (1600, 800)

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


Added :
 try {
                Thread.sleep(1000);
            } catch (InterruptedException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
after the maximise command, before reading the size.
Still reports the same size.
Thanks! 
How about adding a sleep, like 10 seconds before System.out.println("After " + driver.manage().window().getSize());
Does the result change?
Same behaviour with 10s sleep
Thanks! Looks like chrome can not make the window maximized for some reason. Are you using a X display, or xvfb?
Using https://hub.docker.com/r/selenium/standalone-chrome/, which Im pretty sure is using xvfb inside
OK. Then the problem is probably due to xvfb. It is a known issue for a long time, see https://cs.chromium.org/chromium/src/chrome/test/chromedriver/test/run_py_tests.py?l=113.

Though I don't know how to fix it. You may need to use the setSize method instead.
But this code has worked for many years without crashing or throwing exceptions.
And others have the same issue with Chrome 62 on Windows
@xle...@gmail.com
Thanks for workaround. It works in Codeception framework (http://codeception.com/) when using this YML configuration:
-------
modules:
    enabled:
        - WebDriver:
            browser: chrome
            window_size: maximize
            capabilities:
                    args:
                        [start-maximized]

Comment 31 by xle...@gmail.com, 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.
This issue was also being handled in https://bugs.chromium.org/p/chromedriver/issues/detail?id=1946 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='-Dwebdriver.chrome.verboseLogging=true' selenium/standalone-chrome:3.5.2-antimony

  # On another shell
  python2.7
  from selenium import webdriver
  browser =  webdriver.Remote("http://127.0.0.1:4444/wd/hub", webdriver.DesiredCapabilities.CHROME)
  browser.maximize_window()

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

ChromeDriver_verbose.log
16.8 KB View Download
I also suffer from this problem when using XvFB.

Selenium: 3.4.0
Chrome: 61
Chromedriver: 2.32.


Project Member

Comment 34 by johnchen@chromium.org, Oct 20 2017

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.
Chromer Driver: 2.30.0.1 and Chrome: 62.0.3202.94 (Official Build) (64-bit)
Facing this issue with Maximize. Kindly help me resolve this issue.
Project Member

Comment 36 by johnchen@chromium.org, Nov 27 2017

Re comment #35: This is caused by  issue #1918 . Please upgrade to ChromeDriver 2.33.
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
Project Member

Comment 38 by johnchen@chromium.org, Nov 27 2017

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 bino...@gmail.com, 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

https://bugs.chromium.org/p/chromedriver/issues/detail?id=2173


Sign in to add a comment