1

I get the following popup box when I try to run my selenium script in java:

Failed to load extension from:
C:\Users\xyz\AppData\Local\Temp\scoped_dir20432_5430\internal. Loading of unpacked extensions is disabled by the administrator.

enter image description here

I have tried chromeoption arguments I have found in other pages. But none seems to work.

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
public class testClass {

     public static String driverPath = "D:/Selenium/Chrome Driver latest/chromedriver.exe";
     public static WebDriver driver;

public static void main(String args[]) {
    System.setProperty("webdriver.chrome.driver", driverPath);

    ChromeOptions options = new ChromeOptions();
    options.addArguments("test-type");
    options.addArguments("start-maximized");
    options.addArguments("--js-flags=--expose-gc");
    options.addArguments("--enable-precise-memory-info");
    options.addArguments("--disable-popup-blocking");
    options.addArguments("--disable-default-apps");
    options.addArguments("--enable-automation");
    options.addArguments("test-type=browser");
    options.addArguments("disable-infobars");
    options.addArguments("disable-extensions");

    driver = new ChromeDriver(options);
    driver.navigate().to("http://google.com");
    driver.quit();
}
}

I am forced to handle that popup manually. How do I get rid of it ?

  • I have the same issue. Did you find any solution for this ? – debugger89 Jul 26 '17 at 7:49
  • @debugger89 No, not yet. – kaushik3993 Aug 7 '17 at 5:58
1

As seen on chromium bug #639, try setting useAutomationExtension to false.

options.setExperimentalOption("useAutomationExtension", false);
0

Here is the Answer to your Question:

Replace

options.addArguments("disable-extensions");

in your code by

options.addArguments("--disable-extensions");

Let me know if this helps you.

  • I still get the same pop up box after replacing that line of code with yours. – kaushik3993 May 22 '17 at 4:56
  • Can you add a snapshot of what you mean by pop-up box? – DebanjanB May 22 '17 at 5:01
  • I've added the snapshot in the question – kaushik3993 May 22 '17 at 5:12
  • It's not a pop-up, it's an error – DebanjanB May 22 '17 at 5:13
  • But when I click Ok, the script is executed and works fine. – kaushik3993 May 22 '17 at 5:18
0

In C# the below command does not seem to work

options.AddArgument("disable-extensions");

So I used AddAdditionalCapability to resolve the pop-up issue

ChromeOptions options = new ChromeOptions();            
options.AddAdditionalCapability("useAutomationExtension", false);
var driver = new ChromeDriver(options);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.