Selenium: unknown error: cannot get automation extension

Created on 15 Feb 2017  Â·  23Comments  Â·  Source: SeleniumHQ/selenium

Meta -

OS:
Windows 10
Selenium Version:
2.53.0 standalone
Browser:
Chrome

Browser Version:
49

Expected Behavior -

running below methods properly
driver.manager().window().maximize()
driver.manage().window().getSize()

Actual Behavior -

D:\Java\Selenium>java -jar "D:\Java\Selenium\selenium-server-standalone-2.53.0.jar" -port 4723 -Dwebdriver.chrome.driver="D:\Java\chromedriver_win32_2.27\chromedriver.exe"
15:50:55.086 INFO - Launching a standalone Selenium Server
Setting system property webdriver.chrome.driver to D:\Java\chromedriver_win32_2.27\chromedriver.exe
15:50:55.124 INFO - Java: Oracle Corporation 25.121-b13
15:50:55.126 INFO - OS: Windows 10 10.0 amd64
15:50:55.134 INFO - v2.53.0, with Core v2.53.0. Built from revision 35ae25b
15:50:55.176 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:50:55.177 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
15:50:55.184 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
15:50:55.188 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
15:50:55.190 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
15:50:55.246 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4723/wd/hub
15:50:55.248 INFO - Selenium Server is up and running
15:51:14.266 INFO - Executing: [new session: Capabilities [{browserName=chrome, chromeOptions={args=[], extensions=[], binary=D:\Mobility\Shell\branches\Develop\Windows\Debug\StayinFront.Touch.exe}, version=, platform=ANY}]])
15:51:14.278 INFO - Creating a new session for Capabilities [{browserName=chrome, chromeOptions={args=[], extensions=[], binary=D:\Mobility\Shell\branches\Develop\Windows\Debug\StayinFront.Touch.exe}, version=, platform=ANY}]
Starting ChromeDriver 2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9) on port 45126
Only local connections are allowed.
15:51:16.747 INFO - Done: [new session: Capabilities [{browserName=chrome, chromeOptions={args=[], extensions=[], binary=D:\Mobility\Shell\branches\Develop\Windows\Debug\StayinFront.Touch.exe}, version=, platform=ANY}]]
15:53:13.291 INFO - Executing: [maximise window])
15:53:23.391 WARN - Exception thrown
org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: content shell=)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.09 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'Roni10', ip: '192.168.98.14', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=C:Users\RLuo\AppData\LocalTemp\scoped_dir12312_9030}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: c0a2a8d7f47dfb1c14bd39835178b795
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
15:53:23.442 WARN - Exception: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: content shell=)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.09 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'Roni10', ip: '192.168.98.14', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=C:Users\RLuo\AppData\LocalTemp\scoped_dir12312_9030}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: c0a2a8d7f47dfb1c14bd39835178b795
15:53:47.538 INFO - Executing: [get window size])
15:53:57.611 WARN - Exception thrown
org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: content shell=)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.07 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'Roni10', ip: '192.168.98.14', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=C:Users\RLuo\AppData\LocalTemp\scoped_dir12312_9030}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: c0a2a8d7f47dfb1c14bd39835178b795
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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.getSize(RemoteWebDriver.java:914)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.getSize(EventFiringWebDriver.java:636)
at org.openqa.selenium.remote.server.handler.GetWindowSize.call(GetWindowSize.java:31)
at org.openqa.selenium.remote.server.handler.GetWindowSize.call(GetWindowSize.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
15:53:57.687 WARN - Exception: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: content shell=)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.07 seconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:00:58'
System info: host: 'Roni10', ip: '192.168.98.14', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=C:Users\RLuo\AppData\LocalTemp\scoped_dir12312_9030}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: c0a2a8d7f47dfb1c14bd39835178b795

Most helpful comment

if you use chrome 57, you have to use chromedriver 2.28
for disabling infobars just add options.addArguments("--disable-infobars");
to chrome options.

--
Miloš Stanković | Team Lead
Emisia Consulting, Kragujevac, Serbia

On Mon, Mar 27, 2017 at 1:34 PM, czebe notifications@github.com wrote:

I confirm, Chrome 57 breaks all our tests relying on setWindowSize.
Reverting back to an older version may be a temporary fix, but then how do
you test against the latest browser?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/SeleniumHQ/selenium/issues/3508#issuecomment-289427682,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIZVw352_vfyQiVGhAOpkSp_jVSVx4pKks5rp57KgaJpZM4MBQGc
.

All 23 comments

Hi, it looks like you're setting the binary options in chromeOptions to D:\Mobility\Shell\branches\Develop\Windows\Debug\StayinFront.Touch.exe. This should only be the Chrome binary. See https://sites.google.com/a/chromium.org/chromedriver/capabilities

@lmtierney Thank you for your reply. I might not describe it well. The binary setting is correct here. We implemented a CEF browser in our app. We can do all automation tests except ones I listed out.

Oh I see now, I believe the window commands aren't implemented for android chrome. Either way, this would be a chromedriver issue so you'll have to raise a bug with them.

@lmtierney oh ok, thank you!

@rong4188 : This is a long standing issue with Chromedriver. The window resizing doesn't work with the chromedriver and the community is silent on this bug fix. If the resizing is not critical for your tests, I would suggest you avoid the manage() method altogether and use a workaround of having your browser window always maximized using the ChromeOptions object at the launch of your chromedriver instantiation.

Hope this helps.

Hello There, I just signed up to help you

Okay So HERE IS THE SOLUTION. (Please make this as solved.)
I had this problem today.. and I quickly figured out it has to do something with chrome.
I can see your version is 57 (which is latest version right now..)

Here is the FIX

Download Chrome V 56.0.26**

For Developers.. You may need to update selenium to make it compatible with new version of chrome 💃

Best Regards, Bye.

@AdamWital do you have a link to download v 56.0.26? Most of the links I've seen bring you the default chrome download which downloads the latest.

@mroien : Here you go:
https://www.slimjet.com/chrome/google-chrome-old-version.php

Download the version you desire for chrome from the above repository. After that you have to specify the version you need to use using chromeoptions object while instantiating the ChromeDriver in your test(s)

I confirm, Chrome 57 breaks all our tests relying on setWindowSize. Reverting back to an older version may be a temporary fix, but then how do you test against the latest browser?

if you use chrome 57, you have to use chromedriver 2.28
for disabling infobars just add options.addArguments("--disable-infobars");
to chrome options.

--
Miloš Stanković | Team Lead
Emisia Consulting, Kragujevac, Serbia

On Mon, Mar 27, 2017 at 1:34 PM, czebe notifications@github.com wrote:

I confirm, Chrome 57 breaks all our tests relying on setWindowSize.
Reverting back to an older version may be a temporary fix, but then how do
you test against the latest browser?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/SeleniumHQ/selenium/issues/3508#issuecomment-289427682,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIZVw352_vfyQiVGhAOpkSp_jVSVx4pKks5rp57KgaJpZM4MBQGc
.

Please upgrade to the latest version of Chromedriver v2.28.
You can download it from https://sites.google.com/a/chromium.org/chromedriver/downloads

Installing latest chromedriver AND removing the browser.manage().window().setSize(1280, 990) for example, fixes this.

Another solution depending on your dependencies/toolkit is to upgrade to latest protractor AND grunt-protractor-runner if you are using grunt etc. This way I can keep the setSize method.

I ran into same issue and using 2.28 version fixed problem. https://chromedriver.storage.googleapis.com/index.html?path=2.28/

2.28 did fix the issue. Thanks

I have just used the latest version and it's working fine .. :dancer:

Hello all ,

i just surfed a lot for this issue and finally landed up here Thanks everybody ! Mr M-Sr comment actually worked for me Thank you . ..when i commented the "driver.maximize" and "driver.wait" , the code worked.

my system cofig. is
windows 10 64 bit
selenium 2.5.3
chrome browser 58
chromedriver 2.29
even with the latest versions in place, I had this issues..finally commenting those two lines helped.

I would also like to know if "driver.maximize" or "driver.wait" command does not work in chromedriver 2.29 ..then what commands can replace those functionality.Please share the info if anyone knows it. Thanks!

@Poojacp This should help. Set the window size instead of 1024,768
This configuration is for nodeJS. The Java equivalent should be something similar.

capabilities: [{
    chromeOptions: {
        args: ["--window-size=1024,768"]
    }
}]

Chromedriver version 2.31 resolves the problem:
https://sites.google.com/a/chromium.org/chromedriver/downloads

If you have chromedriver installed via homebrew, run brew upgrade chromedriver to get the latest version.

Hi All,

I am using below data

  1. Node : v6.11.3
  2. npm : 3.10.10
  3. protractor : 5.1.2
  4. chrome browser version : 61.0.3163.100

I tried to take the screenshot of the entire page using "Protractor".

The code is below.

var fs = require('fs');
function writeScreenShot(data, filename) {
var stream = fs.createWriteStream(filename);
stream.write(new Buffer(data, 'base64'));
stream.end();
}

it('should take screentshot', ()=>{
page.navigateTo();
page.getDashboardLink().click();
browser.takeScreenshot().then(function (png) {
writeScreenShot(png, 'exception.png');
});
});

when i run : ng e2e
It is displaying below error message

my-app App should take screentshot

Can any one help me to solve this problem

@Vasundhara-vasu please don't ask questions on closed issues. You need to upgrade your chromedriver. For Chrome version 61 you need either Chromedriver 2.32 or 2.33 and you have 2.26

Can any one help me
I am getting the below error, when I used ExtendedSelenium2Library in RIDE tool,
[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: WebDriverException: Message: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=75.0.3770.100)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.10586 x86_64)

Was this page helpful?
0 / 5 - 0 ratings