driver.manage().window().maximize() gives exception on Chrome v 57

1,043 views
Skip to first unread message

Denis

unread,
Apr 4, 2017, 5:14:14 PM4/4/17
to Selenium Users
The selenium code to maximize the Chrome browser no longer version starting from latest Chrome version 57 and gives an exception. I tried with latest version of Selenium and Chromedriver and it still fails. This is a blocker for me. Does anyone have the same issue or can provide a workaround (which does not involve heavy handed Java Robot approach because it is so brittle)?
Code line in question:
driver.manage().window().maximize()
Here is the stack trace exception:
unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html (Session info: chrome=57.0.2987.133) (Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 10.10 seconds Build info: version: '3.2.0', revision: '8c03df6b79', time: '2017-02-23 10:51:31 +0000' System info: host: 'REDWOODAGENT3', ip: '192.168.2.214', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_65' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed), userDataDir=C:\Program Files (x86)\RedwoodHQ Agent\logs\scoped_dir2656_32499}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=57.0.2987.133, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 264831e844eccd646b05237324f917b2

Anish Pillai

unread,
Apr 5, 2017, 12:25:38 AM4/5/17
to Selenium Users
Hi,

Don't use driver.manager().window().maximize() for Chrome. Try the below logic instead -

ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");

WebDriver driver = new ChromeDriver(options);
driver.get(.....);


Cheers, Anish
AutomationTestingHub

Xiang Dong

unread,
Apr 7, 2017, 11:49:21 PM4/7/17
to seleniu...@googlegroups.com

I have the same issue with chromedriver 2.27+Chrome 57, but after upgrading chromedriver with latest version (2.28),  issue solved. I am not sure why it does not works for your case. You can try delete all extensions from your chrome.


It seems you are using ChromeDriver 2.25.426923, it is too old to support Chrome 57


Best Regards,

--david 




From: seleniu...@googlegroups.com <seleniu...@googlegroups.com> on behalf of Denis <denisn...@gmail.com>
Sent: Wednesday, April 5, 2017 5:14 AM
To: Selenium Users
Subject: [selenium-users] driver.manage().window().maximize() gives exception on Chrome v 57
 
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ffd32980-f888-4e4e-b5a7-a111c15140f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

saurabh verma

unread,
Apr 9, 2017, 2:54:23 AM4/9/17
to Selenium Users
Reply all
Reply to author
Forward
0 new messages