New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to change window state to maximized, current state is normal exception thrown on 3.4.0-francium and above versions #559

Closed
shankarkc opened this Issue Sep 7, 2017 · 16 comments

Comments

Projects
None yet
@shankarkc
Copy link

shankarkc commented Sep 7, 2017

Meta -

Image(s):

Node-chrome
Docker-Selenium Image Version(s):
3.4.0-francium and above versions fail.
It works fine in .4.0-einsteinium

OS:

Linux Ubuntu 14

Expected Behavior -

Maximize window should work. But it throws exception : -

org.openqa.selenium.WebDriverException: unknown error: failed to change window state to maximized, current state is normal
  (Session info: chrome=61.0.3163.79)
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.2.0-42-generic x86_64) (WARNING: The server did not provide any stacktrace information)

On node i see below call stack

06:52:10.765 INFO - Mismatched capabilities. Creating a synthetic w3c capability.
06:52:10.772 INFO - Capabilities are: Capabilities {proxy={httpProxy=10.163.3.125:443, proxyType=manual, sslProxy=10.163.3.125:443, }, nativeEvents=false, acceptSslCerts=true, jenkins.label=Buyer, browserName=chrome, }
06:52:10.778 INFO - Capabilities {proxy={httpProxy=10.163.3.125:443, proxyType=manual, sslProxy=10.163.3.125:443, }, nativeEvents=false, acceptSslCerts=true, jenkins.label=Buyer, browserName=chrome, } matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
06:52:10.779 INFO - Capabilities {proxy={httpProxy=10.163.3.125:443, proxyType=manual, sslProxy=10.163.3.125:443, }, nativeEvents=false, acceptSslCerts=true, jenkins.label=Buyer, browserName=chrome, } matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 6047
Only local connections are allowed.
06:52:16.123 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@29fa9e9e
06:52:16.123 INFO - Handler thread for session c07469a554412421cdcc77deed37a836 (chrome): Executing POST on /session/c07469a554412421cdcc77deed37a836/window/current/maximize (handler: ServicedSession)
06:52:16.133 INFO - To upstream: {"windowHandle":"current","handle":"current"}
06:52:16.244 INFO - To downstream: {"sessionId":"c07469a554412421cdcc77deed37a836","status":13,"value":{"message":"unknown error: failed to change window state to maximized, current state is normal\n  (Session info: chrome=61.0.3163.79)\n  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.2.0-42-generic x86_64)"}}
06:52:47.413 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@29fa9e9e
06:52:47.414 INFO - Handler thread for session c07469a554412421cdcc77deed37a836 (chrome): Executing DELETE on /session/c07469a554412421cdcc77deed37a836 (handler: ServicedSession)
06:52:47.469 INFO - To downstream: {"sessionId":"c07469a554412421cdcc77deed37a836","status":0,"value":null}
06:52:47.473 INFO - Removing session org.openqa.selenium.remote.server.ServicedSession@29fa9e9e
06:52:47.475 INFO - To downstream: {"sessionId":"c07469a554412421cdcc77deed37a836","status":0,"value":null}

Actual Behavior -

@Zechtitus

This comment has been minimized.

Copy link

Zechtitus commented Sep 10, 2017

I posted another issue about window maximize here: #562

possible this is similar issue?

@shankarkc

This comment has been minimized.

Copy link

shankarkc commented Sep 11, 2017

I am using below code
webDriver.manage().window().setSize(new Dimension(1600,900));
As per your description it won't occur when we specify size. In my code i do specify size. Still maximize fails. So potentially its a different issue.

@QA2017

This comment has been minimized.

Copy link

QA2017 commented Sep 14, 2017

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

I am angry, so so angry

@shankarkc

This comment has been minimized.

Copy link

shankarkc commented Sep 14, 2017

@QA2017 there is
a workaround mentioned here. https://bugs.chromium.org/p/chromedriver/issues/detail?id=1901
I have not tried it though. You can give a shot. It says try
capabilities:
args:
[start-maximized]

@diemol

This comment has been minimized.

Copy link
Member

diemol commented Oct 3, 2017

For Firefox see #575,

We'll investigate for Chrome.

@shankarkc

This comment has been minimized.

Copy link

shankarkc commented Oct 4, 2017

@QA2017
I am using 3.6.0-americium release
I was executing below setSize after calling get

       webDriver.get(url);
	// setting browser window size
	webDriver.manage().window().setSize(new Dimension(1600,900));

I removed the setsize just after

  webDriver.get(url);

I do call this API at latter part in my code to change the window size. there it didnt give any error to me. Just remove setsize/maximize calls immediately after getting webdriver. I think it needs some time to stabilize or sth like that... It helped me. How that it helps you too.

@diemol

This comment has been minimized.

Copy link
Member

diemol commented Oct 5, 2017

I checked and this started failing since the 60.0.3112.78 release (as seen in the linked bug report), and this does not seem related to the commits included docker-selenium releases after 3.4.0-einsteinium.

I also tried with the current beta version, and it does not work either. It all seems related to the fact that there is no window manager in the node-chrome and node-firefox containers, as mentioned in this SO answer.

The workaround for now is to set the window size as @shankarkc says, or use the debug containers (I did a very small test using the headless and the debug container, the resource usage looks very similar).

Please follow the bug report for updates.

@devesh-jelli

This comment has been minimized.

Copy link

devesh-jelli commented Oct 9, 2017

The workaround pointed out by @shankarkc worked for me. I removed the maximize window call immediately after initializing the webdriver and that seems to have resolved the issue.

@shankarkc

This comment has been minimized.

Copy link

shankarkc commented Oct 10, 2017

I am closing this as its not a blocker and we have a workaround.

@shankarkc shankarkc closed this Oct 10, 2017

@joshmgrant

This comment has been minimized.

Copy link

joshmgrant commented Dec 21, 2017

I am having this same issue with a coworker using 3.8.1-bohrium and the NodeChrome container with Protractor 5.1.2, Chrome 63 and chromedriver 2.34. The above workarounds are not working in our Protractor config files.

@olivierhub

This comment has been minimized.

Copy link

olivierhub commented Dec 22, 2017

I had the same problem.
I found out that launching a window manager like fluxbox solves the problem.
Without a window manager, maximize fails. With a window manager, it succeeds.
Obviously you have to modify the docker image in order to install and launch fluxbox.
It could be a hint for debugging the root cause of the problem: maybe since chromedriver 2.30+ the maximize operation relies on the window manager, so it fails when there is not one.

@diemol

This comment has been minimized.

Copy link
Member

diemol commented Dec 22, 2017

Yes, that is what I also saw when debugging this. The good news is that the debug images already have fluxbox installed. So you could use those ones.

I'll start digging soon into the performance differences between the normal and debug images, hopefully to find out that there are not significant ones, and if so, the idea is to merge them.

@user667 user667 referenced this issue Jan 19, 2018

Closed

#675: Chrome browser gets maximized #680

2 of 3 tasks complete
@ZoeThivet

This comment has been minimized.

Copy link

ZoeThivet commented Jan 30, 2018

@shankarkc it did help me, thank you :)

@Shashank-Java

This comment has been minimized.

Copy link

Shashank-Java commented Apr 6, 2018

I am having this same issue with Chrome 65 and chromedriver 2.36.
I am using "driver.manage().window().maximize();" but it is not working, still I am getting same error.

mikhailvkutuzov pushed a commit to mikhailvkutuzov/TF that referenced this issue May 20, 2018

mikhail.kutuzov
* try to fix something like this SeleniumHQ/docker-selenium#559
we've faced this issue on jenkins + ubuntu  + headless chrome mode configuration

mikhailvkutuzov pushed a commit to mikhailvkutuzov/TF that referenced this issue May 20, 2018

mikhail.kutuzov
* one more try : try to fix something like this SeleniumHQ/docker-sel…
…enium#559

we've faced this issue on jenkins + ubuntu  + headless chrome mode configuration

mikhailvkutuzov pushed a commit to mikhailvkutuzov/TF that referenced this issue May 20, 2018

mikhailvkutuzov pushed a commit to mikhailvkutuzov/TF that referenced this issue May 20, 2018

m-bucher added a commit to ATIX-AG/airgun that referenced this issue May 29, 2018

abalakh added a commit to SatelliteQE/airgun that referenced this issue May 30, 2018

Add support for chrome in docker (#94)
* Add support for chrome in docker

select docker image based on:
* webdriver: either firefox(default) or chrome
* selenium-version: prefer selenium docker-image with the same version
  as the installed selenium-module, but fallback to 'latest'

* Fix maximize-window issue with chrome in docker

Add workaround from SeleniumHQ/docker-selenium#559

* fixup! Add support for chrome in docker

* fixup! Fix maximize-window issue with chrome in docker

schlupov added a commit to schlupov/airgun that referenced this issue Jul 2, 2018

Add support for chrome in docker (#94)
* Add support for chrome in docker

select docker image based on:
* webdriver: either firefox(default) or chrome
* selenium-version: prefer selenium docker-image with the same version
  as the installed selenium-module, but fallback to 'latest'

* Fix maximize-window issue with chrome in docker

Add workaround from SeleniumHQ/docker-selenium#559

* fixup! Add support for chrome in docker

* fixup! Fix maximize-window issue with chrome in docker

schlupov added a commit to schlupov/airgun that referenced this issue Jul 26, 2018

Add support for chrome in docker (#94)
* Add support for chrome in docker

select docker image based on:
* webdriver: either firefox(default) or chrome
* selenium-version: prefer selenium docker-image with the same version
  as the installed selenium-module, but fallback to 'latest'

* Fix maximize-window issue with chrome in docker

Add workaround from SeleniumHQ/docker-selenium#559

* fixup! Add support for chrome in docker

* fixup! Fix maximize-window issue with chrome in docker
@PratapAkshay

This comment has been minimized.

Copy link

PratapAkshay commented Nov 22, 2018

clickonEquipments:function(){
driver.executeScript("windiw.scrollTo(0,1000)");
}
ITs showing error : -
(node:78923) UnhandledPromiseRejectionWarning: WebDriverError: unknown error: windiw is not defined
please help..?

@cgoldberg

This comment has been minimized.

Copy link
Member

cgoldberg commented Nov 22, 2018

@PratapAkshay

  1. your spelling is not correct (windiw?)
  2. please don't hijack unrelated issues.

danbao added a commit to danbao/testring that referenced this issue Nov 23, 2018

AUT-13294 Possible issues WebDriver Chrome, change logger.error to lo…
…gger.warn to let report will not failed due this bug

refer SeleniumHQ/docker-selenium#559
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment