Chrome - org.openqa.selenium.WebDriverException:未知错误:无法在driver.manage()。window()。 [英] Chrome - org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension at driver.manage().window().maximize();

查看:139
本文介绍了Chrome - org.openqa.selenium.WebDriverException:未知错误:无法在driver.manage()。window()。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我被Chrome浏览器抛出的一种非常常见的错误卡住了

strong>
当我尝试使用下面的代码行来最大化铬时

  driver.manage()。window )。最大化(); 

我越来越低于错误

  org.openqa.selenium.WebDriverException:未知错误:无法获取自动扩展名
来自未知错误:无法找到页面:chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(会话信息:chrome = 57.0.2987.110)
(驱动程序信息:chromedriver = 2.27.440174(e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform = Windows NT 6.3.9600 x86_64)(警告:服务器未提供任何堆栈跟踪信息)
命令持续时间或超时时间:10.05秒

通过浏览例子我做了以下的事情:

  1。更新的chrome驱动程序到最新的ie 2.28,用于我的chrome版本
57.0.2987.110(64位)
2.卸载并重新安装chrome
3.在eclipse中建立了一个项目,甚至创建一个新的空间

但没有任何帮助,所以我用了

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

当我执行某个作品时,它的工作和chrome驱动程序显示没有错误的代码,如填写表单或点击某个按钮后,它仍然会在一段时间后抛出上述错误。 任何人都可以提供帮助吗?

解决方案

一般而言,您会看到 WebDriverException:未知错误:无法获得自动扩展 可能很多。查看此例外的两种最常见情况是:


  1. chromedriver 二进制版本和 Chrome浏览器 二进制版本。 解决方案:按照 ChromeDriver发行说明
  2. 使用 driver.manage()。window()。maximize() ; 最大化 Chrome浏览器解决方案:使用 ChromeOptions.addArguments(start-maximized); Chrome浏览器






似乎是来自以上情况之一。



请尝试以下步骤:


  1. 杀死所有在您的Windows任务管理器中运行的 chromedriver 实例。

  2. 使用 CCleaner
  3. code>工具来清除所有 OS 杂项。
  4. 清理Eclipse中的所有项目。 b $ b
  5. 重新启动系统一次。
  6. $ p> ChromeOptions options = new ChromeOptions();
    options.addArguments(test-type);
    options.addArguments(start-maximized);
    options.addArguments(disable-infobars);
    options.addArguments( - disable-extensions);
    驱动程序=新的C​​hromeDriver(选项);


您的程序应该可以使用最新的chrome驱动程序2.28 &安培; Chrome版本57.0.2987.110(64位)。让我知道这是否有助于您。


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 ?

解决方案

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.

这篇关于Chrome - org.openqa.selenium.WebDriverException:未知错误:无法在driver.manage()。window()。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆