Chrome - org.openqa.selenium.WebDriverException: Unknown error: Unable to get automation extension in driver.manage (). Window (). Maximize ();

Hi everyone, I am stuck with a very unusual kind of errors thrown by Chrome browser

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

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

I get below the 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 

Looking through this example , I did the following things

 1. Updated chrome driver to latest ie 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 the chrome driver did not show an error , but every time I executed some piece of code, for example, filling out a form or clicking on some button, after which it still gives the above error after some time. Can anyone help?

+5
source share
2 answers

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 are:

  • The mismatch between the binary versions of chromedriver and Chrome Browser . Solution . Follow ChromeDriver Release Notes
  • Using driver.manage().window().maximize(); to maximize Chrome Browser . Solution . Use ChromeOptions.addArguments("start-maximized"); to maximize Chrome Browser .

According to your question, the exception seems to come from one of the above cases.

Try the following steps:

  • Kill all instances of chromedriver running in your Windows Task Manager.
  • Use the CCleaner tool to destroy all OS operations.
  • Clear all projects in Eclipse.
  • Reboot the system once.
  • Provide the following options for launching the 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 the latest chrome 2.28 driver and Chrome version 57.0.2987.110 (64-bit). Let me know if this helps you.

+4
source

I had the same problem before, remember that it was fixed by adding the following:

 ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("no-sandbox"); //Fix for cannot get automation extension chromeOptions.addArguments("disable-extensions"); chromeOptions.addArguments("--start-maximized"); 
+2
source

Source: https://habr.com/ru/post/1265832/


All Articles