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
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}
I posted another issue about window maximize here: https://github.com/SeleniumHQ/docker-selenium/issues/562
possible this is similar issue?
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.
unknown error: failed to change window state to maximized, current state is normal
I am angry, so so angry
@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]
For Firefox see #575,
We'll investigate for Chrome.
@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.
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.
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.
I am closing this as its not a blocker and we have a workaround.
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.
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.
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.
@shankarkc it did help me, thank you :)
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.
clickonEquipments:function(){
driver.executeScript("windiw.scrollTo(0,1000)");
}
ITs showing error : -
(node:78923) UnhandledPromiseRejectionWarning: WebDriverError: unknown error: windiw is not defined
please help..?
@PratapAkshay
windiw?)Had exactly the same issue with 3.14 chrome debug docker image. I call maximize_window() right after webdriver.Remote(....). So I put time.sleep(5) between these two lines and it fixes the issue.
Seems like the browser window need some time to be fully rendered.
Most helpful comment
unknown error: failed to change window state to maximized, current state is normal
I am angry, so so angry