Home ChromeDriver C# Disable developer extensions selenium
Reply: 1

ChromeDriver C# Disable developer extensions selenium

usr4896260
1#
usr4896260 Published in 2018-01-12 20:45:27Z

I'm trying to disable extensions when running selenium in my C# project. Using the example here, I was able to do so.

ChromeOptions options = new ChromeOptions();
options.AddArgument("--start-maximized");
options.AddArguments("--disable-extensions");
var drv = new ChromeDriver("MY_CHROME_DRIVER_PATH", options);

However, this doesn't work with the latest version of Chrome v63 and the selenium webdriver v2.9. After doing some research, I found that the driver includes an automation extension which is still enabled, when the disable extensions argument is passed. The suggestion used below does not work with the .NET driver.

chromeOptions.setExperimentalOption("useAutomationExtension", false);

As I have a managed machine and I can't enable the access to install Chrome extensions. How do I disable all extensions along with the automation extension in C#?

usr4896260
2#
usr4896260 Reply to 2018-01-15 14:48:31Z

Thanks to JimEvans, I was able to find a solution by updating to the latest driver v2.35 and adding the additional capability as follows:

options.AddAdditionalCapability("useAutomationExtension", false);

Additionally, if one wants to the automation infobar, the can use the following:

options.AddArguments("--disable-infobars");
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30765 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO