Reputation: 103
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.
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 ?
Upvotes: 4
Views: 22730
Reputation: 11
Updating to the latest compatible chromedriver.exe
will resolve the issue.
Upvotes: 0
Reputation: 146
I had the same problem and I finally found a working answer in another thread. Loading of unpacked extensions is disabled by the administrator
The following line did the trickt for me
options.setExperimentalOption("useAutomationExtension", false);
There are some trade-offs mentioned in the link, like window resizing operations with the Chrome automation extension aren't possible anymore. Anyway, starting with the start-maximized argument still worked fine in my code.
options.addArguments("start-maximized");
Upvotes: 13