6.2.25.1.2n/aChromen/aAfter updating to Google Chrome 60.0.3112.78 this morning, Protractor fails when trying to browser.driver.manage().window().maximize()
Error:
WebDriverError: unknown error: failed to change window state to maximized, current state is normal
Hi @rdbaron
Which version of ChromeDriver are you on. I'm on 2.31 with Chrome 60 on a Mac with the latest OSX
I get this when using browser.driver.manage().window().maximize()
21:23:11.237 INFO - Creating a new session for Capabilities [{count=1, browserName=chrome, chromeOptions={args=[disable-infobars]}, maxInstances=1, shardTestFiles=true}]
Starting ChromeDriver 2.31.488774 (7e15618d1bf16df8bf0ecf2914ed1964a387ba0b) on port 17236
Only local connections are allowed.
21:23:11.929 INFO - Detected dialect: OSS
21:23:11.932 INFO - Done: [new session: Capabilities [{count=1, browserName=chrome, chromeOptions={args=[disable-infobars]}, maxInstances=1, shardTestFiles=true}]]
21:23:11.950 INFO - Executing: [script wait: 60000])
21:23:11.953 INFO - Done: [script wait: 60000]
21:23:12.269 INFO - Executing: [maximise window])
21:23:12.679 INFO - Done: [maximise window]
Works on my machine ;-). Can you please check your webdriver log?
@wswebcreation
Hmm.. I am also on chromedriver 2.31, though I am running on Debian Jessie (inside a Docker container).
The webdriver logs are on a remote CI server that I don't have access to at the moment. I'll try to get a hold of those and post them. For now the best I can do is give the full stack from the console output:
[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)
@rdbaron
Resetting it to Chrome 59 fixes the problem? If so then it would be more likely to be a bug in ChromeDriver in combination with your platform.
Protractor is _only a wrapper_ around Webdriver, managing the browsers is done with webdriver-manager (separate dependency). I would "say" this is a "thirdparrty" issue and not a Protractor issue and therefore would suggest to add an issue there and not here.
@wswebcreation
I figured it was more likely an issue elsewhere, but I thought you guys might want an issue in case you'd need to update to a new version of a dependency once fixed.
Happy to close it if that's not the case though.
Chromedriver is automatically updated to the latest version with a webdriver-manager update.
So Protractor _takes care of this_. I do appreciate that you logged it here with your provided info.
I'm going to close it for now but please update it here if you have more info
Grtz
wswebcreation
Hello can you pls reopen the bug? I too hit this issue on docker selenium grid.
OS : - Ubuntu 16 image
chrome browser version : 60.0.3112.78
chrome webdriver 2.31
Webdriver : 2.53.1
call stack :
Command duration or timeout: 108 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'df46c666fa71', ip: '10.0.9.5', os.name: 'Linux', os.arch: 'amd64', os.version: '4.2.0-27-generic', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8), userDataDir=/tmp/.org.chromium.Chromium.91hHFN}, 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=}]
Session ID: 5c3f4c06ac71ee9f705fea89e4f52490
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'xxxxxxx', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-83-generic', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:945)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.maximize(EventFiringWebDriver.java:644)
at org.openqa.selenium.remote.server.handler.MaximizeWindow.call(MaximizeWindow.java:30)
at org.openqa.selenium.remote.server.handler.MaximizeWindow.call(MaximizeWindow.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
If i switch to chrome webdriver 2.26 everything works fine.
I got the same issue with Chrome 60 (chrome driver 2.30/2.31, Selenium 3.4, Ubuntu 17.04) in AT framework Codeception.
As a workaround I have to specify window size in my suite config manually, e.g. window_size: 1920 x 1080 (instead of window_size: maximize).
BTW latest Firefox has similar issue, see https://github.com/mozilla/geckodriver/issues/820
Just in case anyone else lands here -
I was able to reproduce the issue by starting Chromedriver directly (without going through webdriver-manager) so the problem almost certainly lies there.
I've logged https://bugs.chromium.org/p/chromedriver/issues/detail?id=1901
@rdbaron
Tnx for the info and the link
Is it possible to reopen this issue as I am getting this issue on Chrome Version 63.0.3239.132 (Official Build) (64-bit)
No trace to report, it just fails in java on the code line where driver.manage().window().maximize(); is called.
I'm getting the same error while trying to reset to window position.
driver.manage().window().setPosition(new Point(0, 0));
os.name: 'Mac OS X'
os.version: '10.12.6'
java.version: '1.8.0_161'
chromedriver : 2.34.522932,
chrome Version : 63.0.3239.132
Call Stack:
org.openqa.selenium.WebDriverException: unknown error: failed to change window state to normal, current state is maximized
(Session info: chrome=63.0.3239.132)
(Driver info: chromedriver=2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e),platform=Mac OS X 10.12.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 112 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: '3901C502959LM.local', ip: 'fe80:0:0:0:4d7:7a29:54de:7ec0%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e), userDataDir=/var/folders/50/vl12tmcn37x0tl62mm9_2tz0m3fc4b/T/.org.chromium.Chromium.zAXuKz}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=63.0.3239.132, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
Session ID: d504aa3719b4cb6ef9e84364b37613c7
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.setPosition(RemoteWebDriver.java:895)
at com.espn.common.testing.util.BrowserControl.setDefaultBrowserPosition(BrowserControl.java:61)
at com.espn.common.testing.test.BaseTest.setUpDriver(BaseTest.java:354)
at com.espn.common.testing.test.BaseTest.executeBeforeMethod(BaseTest.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:599)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Same here...
org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:892)
at BasicTest.googleExampleThatSearchesFor(BasicTest.java:22)
at BasicTest.googleCheeseExample(BasicTest.java:46)
It needs to be FIXED!
Getting the same error with MacOS High Sierra with Chrome Version 70.0.3538.67 (Official Build) (64-bit) after upgrading to ChromeDriver 2.43:
...
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: failed to change window state to maximized, current state is normal
(Session info: chrome=70.0.3538.67)
(Driver info: chromedriver=2.43.600229 (3fae4d0cda5334b4f533bede5a4787f7b832d052),platform=Mac OS X 10.13.6 x86_64)
Getting the same error with MacOS High Sierra with Chrome Version 70.0.3538.67 (Official Build) (64-bit) after upgrading to ChromeDriver 2.43:
...
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: failed to change window state to maximized, current state is normal
(Session info: chrome=70.0.3538.67)
(Driver info: chromedriver=2.43.600229 (3fae4d0cda5334b4f533bede5a4787f7b832d052),platform=Mac OS X 10.13.6 x86_64)
In my case, it was Xfvb Virtual display. (or the absence of it)
I was running the tests on CI like Jenkins And it had no display.
Also, try to get the current resolution of your display. And just set it to the max.
Let me know if you'r still having the issue.
Hi i am using OS Sierra 10.13.6 with chrome driver 2.41& chrome version 70.0
and getting same error:
selenium.common.exceptions.WebDriverException: Message: unknown error: failed to change window state to maximized, current state is normal
Hi i am using OS Sierra 10.12.6 with chrome driver 2.42 & chrome version 70.0
and getting same error:
WebDriverError: unknown error: failed to change window state to maximized, current state is normal
@srujana13 Are u maximizing the browser in ur config file also. If u r doing this in two places one in config file and other in test file then this issue occurs. The fix for this is to add following to ` capabilities: {
'browserName': 'chrome',
'chromeOptions': {
args: [ '--start-maximized',
'--disable-impl-side-painting'
]
}
},
@samiullah hi, i tried doing the above, im still facing the issue
@srujana13 are u using browser.manage().window.maximize() in ur OnPrepare block also??
@samiullah yess, if i comment that code out, it's working
@srujana13 so the workahead (Jugaad) is that we we remove "browser.manage().window.maximize()" from our OnPrepare block and add --start-maximized argument in ur chromeoptions. Hope this helps u . Also dnt use "browser.manage().window.maximize()" inside ur tests also
okay thank you so much :)
I believe this issue is back in chrome #80.
Most helpful comment
Is it possible to reopen this issue as I am getting this issue on Chrome Version 63.0.3239.132 (Official Build) (64-bit)
No trace to report, it just fails in java on the code line where driver.manage().window().maximize(); is called.