ChromeDriver error “unknown error: cannot get automation extension”

后端 未结 15 2066
星月不相逢
星月不相逢 2020-12-10 23:43

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 ext         


        
相关标签:
15条回答
  • 2020-12-11 00:31

    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.

    0 讨论(0)
  • 2020-12-11 00:31

    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.

    0 讨论(0)
  • 2020-12-11 00:33

    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);
    
    0 讨论(0)
  • 2020-12-11 00:35

    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.

    0 讨论(0)
  • 2020-12-11 00:43

    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);
    
    0 讨论(0)
  • 2020-12-11 00:43

    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+.
    0 讨论(0)
提交回复
热议问题