-1

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

I can't find a solution to prevent this pop-up each time I run test cases. Everything I've tried doesn't work and has been posted a two or more years ago. Yes this is something of a duplicate post but those solutions from 2+ years ago no longer work hence I'm asking again. This one is almost three years old discussing older versions of Chrome: Older Post Regarding the same

Working with Java Chrome version is 78.0.3904.87 Selenium version: 3.141.59

System.setProperty("webdriver.chrome.driver", ".\\Drivers\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
WebDriver driver = new ChromeDriver(options);        
options.addArguments("start-maximized");
options.setExperimentalOption("useAutomationExtension", false);
options.addArguments("disable-extensions");

This isn't part of the code now but I also tried this:

options.setExperimentalOption("excludeSwitches", new String[] {"enable-automation"});
AndiCover
  • 1,724
  • 3
  • 17
  • 38
WeVie
  • 568
  • 2
  • 9
  • 25
  • 1
    Please show us more code. Especially what you are doing with `options`. The used Selenium version could also be interesting. – AndiCover Jan 31 '20 at 17:24

1 Answers1

1

I think you need to set all your chrome options before creating the ChromeDriver instance.

System.setProperty("webdriver.chrome.driver", ".\\Drivers\\chromedriver.exe");

ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
options.setExperimentalOption("useAutomationExtension", false);
options.addArguments("disable-extensions");

WebDriver driver = new ChromeDriver(options);

BTW: I would recommend to use the WebDriverManager for handling the correct driver version.

AndiCover
  • 1,724
  • 3
  • 17
  • 38