Chrome Browser-org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension

0
0

Hi all i am stuck with a very un-usual kind of error thrown by Chrome Browser

Senario one
when i try to do maximize chrome with below line of code

driver.manage().window().maximize();

i am getting below error

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: chrome=57.0.2987.110)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 10.05 seconds

By going through this example i did the below things

1. Updated chrome driver to latest i.e 2.28 for my chrome version 
57.0.2987.110 (64-bit)
2. uninstalled and re-installed chrome
3. did a project build up in eclipse even created a new worspace

but nothing helped so i used

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

it worked and chrome driver showed no error but whenever i execute some piece of code like filling a form or clicking some button after that it still throws the above error after some time. Can anyone help ?

  • You must to post comments
0
0

In general the reason you see WebDriverException: unknown error: cannot get automation extension can be numerous. The two most common cases to see this exception is :

  1. Mismatch between chromedriver binary and Chrome Browser binary versions. Solution : Follow the ChromeDriver Release Notes
  2. Using driver.manage().window().maximize(); to maximize the Chrome Browser. Solution : Use ChromeOptions.addArguments("start-maximized"); to maximize the Chrome Browser.


As per your question the exception seems to be coming from one of the above cases.

Try out the following steps:

  1. Kill all the chromedriver instances running in your windows Task Manager.
  2. Use CCleaner tool to wipe out all the OS chores.
  3. Clean all the projects in Eclipse.
  4. Reboot your system once.
  5. Provide the following options to start your Chrome browser:

    ChromeOptions options = new ChromeOptions();
    options.addArguments("test-type");
    options.addArguments("start-maximized");
    options.addArguments("disable-infobars");
    options.addArguments("--disable-extensions");
    driver = new ChromeDriver(options);

Your program should work with latest chrome driver 2.28 & Chrome Version 57.0.2987.110 (64-bit). Let me know if this helps you.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website