Search This Blog

August 10, 2016

Selenium: How to add C# code to Disable Developer mode extensions in Chrome ?

Today, one automated test failed in Chrome. My Chrome version is Chrome 52.0.2743.116.


 After looking into this issue, I noticed that when running the test in Chrome using C# and Selenium , “Disable Developer mode extensions” popbox appeared all the time. That explained why the test failed.

After adding the following code in the file and running the test, “Disable Developer mode extensions” popbox disappears all the time.

  Namespace: using OpenQA.Selenium.Chrome;
  ChromeOptions options = new ChromeOptions();
  options.AddArgument("--disable-extensions");                    
 _driver = new ChromeDriver(options);

No comments: