ChromeDriver error "unknown error: cannot get automation extension"
Asked Answered
M

15

29

Since the 7th of February all my tests are failing with the same error; the log entry reads:

RESPONSE MaximizeWindow 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.21)

I'm not sure if this is caused by a Chrome update or something else - the message is vague enough as it is.

EDIT: I am using C#, and the latest Chromedriver.

Monochromatic answered 13/2, 2017 at 12:55 Comment(2)
What programming language? I think this can be interesting.Feola
I'll give it a shot, although it was working before the 7th of February so it's more of a workaround.Monochromatic
D
45

You need the latest version of chromedriver.exe. https://sites.google.com/a/chromium.org/chromedriver/downloads

This is needed for chromedriver version 57+

I was having this same issue. Once I updated the chromedriver version everything worked again.

Deejay answered 16/3, 2017 at 16:0 Comment(1)
Latest chromedriver (both 2.28 and 2.29) and Chrome ver 58 did not resolve this issue for me. Exact same error on Window.Size.Identification
P
11

Suddenly got this error -> Additional information: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension..

This issue exists even when using ChromeDriver 2.29
What solved it though was removing this line.

driver.Manage().Window.Size = new Size(1024, 768);

A quick fix but really not the one I've been looking for. Would be great to still use the sizing mechanism.

Phipps answered 18/4, 2017 at 9:52 Comment(0)
H
6

This could probably because the environment where you are running the tests is blocking all the third party extensions in chrome browser. Give it a try with disabling the extensions.

something like below:

ChromeOptions o = new ChromeOptions();
o.addArguments("disable-extensions");
o.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(o);
Hamrnand answered 13/2, 2017 at 16:2 Comment(6)
Updating a driver didn't help, but this one did! Thanks!Bitthia
Sorry I'n new to selenium/webdriver, where to put these lines ?Matrix
@Omar this is about driver instantiation.Hamrnand
In which file we have to add this.Despite
@JeevaJsb In a file(test case) where you are invoking the driverHamrnand
I have tried based on the following site. protractortest.org/#. But I didn't find code to invoke the driverDespite
O
4

As mentioned above, it's related to the chromedriver. In the release notes of version 2.33, it's mentioned that they fixed an issue related to resizing/positioning.

Latest Release: ChromeDriver 2.33

Supports Chrome v60-62

Changes include:

  • Fixes a bug which caused Resizing/Positioning Window commands to fail on Chrome 62+.
Outwardly answered 10/11, 2017 at 11:11 Comment(1)
this one exactly fixed my issue on 62 chromeSelle
M
3

Instead of downloading the chrome driver manually, it's better to update the version of chromedriver in package.json (or similar file) and fire npm install to get the latest version auto downloaded.

Morphinism answered 3/5, 2017 at 11:13 Comment(0)
P
1

Try to use Webdrivermanager from

io.github.bonigarcia library

It will automatically load the latest version of your's webdriver and so you will not need to update it from time to time. Just call for example:

ChromeDriverManager.getInstance().setup();

before calling the webdriver itself to get the latest version of ChromeDriver.

Polygamist answered 19/5, 2017 at 12:45 Comment(0)
G
1

Updating your chrome driver exe would not actually fixed this issue, if you observed, it is happening while you're re-sizing chrome driver.Manage().Window.Maximize();

Try to comment this line and try again.

It's a quick fix, I'll update my answer once I find the root cause of this(however it seems because of browser update as nothing was changed in code for me).

Update: For me, it seems to be because of browser update as once I updated again this issue was gone.

Galsworthy answered 4/2, 2018 at 11:25 Comment(0)
R
0

I faced the issue, too. I have replaced the existing chrome driver which I had in my C folder with new chrome driver downloaded from https://sites.google.com/a/chromium.org/chromedriver/downloads, which resolved the issue.

Revisionist answered 17/3, 2017 at 1:50 Comment(1)
When was this version released?Monochromatic
T
0

I had the same issue. Just downloaded the latest release of chromedriver and that solved the problem.

https://sites.google.com/a/chromium.org/chromedriver/downloads

Tempt answered 17/3, 2017 at 13:13 Comment(1)
Please don't use link only answers.Teratogenic
E
0

With the last headless version, you can't resize the window as there isn't any window anymore.

For my own case, I was experiencing this issue with behat, I used to resize the window with previous versions of chrome of firefox, I surround the following line:

$this->getSession()->resizeWindow(1600, 1200, 'current');

with a simple check on the driver:

if (($this->getSession()->getDriver() instanceof Selenium2Driver)) {
    $this->getSession()->resizeWindow(1600, 1200, 'current');
}
Errol answered 20/7, 2017 at 13:2 Comment(0)
O
0

I had started getting the same error in April, shortly after this question. I was able to get around it by installing a new beta version and starting like so: webdriver-manager start --versions.standalone 3.0.0-beta4 --versions.chrome=2.28

This was working perfectly until a few days ago. I tried removing the offending setSize() from my Protractor conf file and it works again. But whenever my tests start, it also spawns another Chrome window navigated to chrome://settings/help. Weird.

I checked my Chrome update history and see it updated from v61 to v62 last week, so that must have broken it. I guess I need to update my driver once more.

Update: For those that want to quickly know how to update their driver:

webdriver-manager update --versions.chrome=2.33

Don't forget to specify the driver when starting the server.

Osborn answered 20/11, 2017 at 21:4 Comment(0)
S
0

Thanks for this -- it helped me after so much R&D

cannot-get-automation-extension

ChromeOptions o = new ChromeOptions();
o.addArguments("disable-extensions");
o.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(o);
Sherrilsherrill answered 11/12, 2017 at 6:13 Comment(0)
F
0

My issue got resolved post adding this comment, thankyou so much.

ChromeOptions o = new ChromeOptions();
o.addArguments("disable-extensions");
o.addArguments("--start-maximized");
o.addArguments("--start-maximized");

WebDriver driver = new ChromeDriver(o);
Frisian answered 13/12, 2017 at 9:29 Comment(0)
M
0

update your protractor and run your test cases it will start executing, there are few new stuff added from Protractor, this method worked for me.

update protractor - npm install -g protractor update webdrvier - webdriver-manager update

Maloy answered 2/5, 2019 at 9:39 Comment(0)
D
-1

it supports the higher versions of chrome driver 2.29.

pls. find the latest chrome drivers in http://www.seleniumhq.org/download/

Devan answered 21/11, 2017 at 10:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.