0

I am trying to Disable a popup which keeps showing up, which is a "Chrome Extension".

I am attaching a screenshot and also the code.

enter image description here

What I am trying to do is I want to click the Disable button.

The code I am using is:

 public static void Initialize()
 {
 //Instance = new FirefoxDriver(); 
 //Instance = new InternetExplorerDriver(@"C:\Sele2"); 
 ChromeOptions options = new ChromeOptions();
 options.AddArguments("--disable-popup-blocking");
 var basePath = AppDomain.CurrentDomain.BaseDirectory;
 Instance = new ChromeDriver(basePath, options);
 Instance.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));

    }

Can someone please help? Thanks in advance

  • 2
    Try with --disable-extensions Take a look here [chromedriver-disable-developer-mode-extensions-on-automation](http://stackoverflow.com/questions/23087724/chromedriver-disable-developer-mode-extensions-on-automation) – lauda Aug 10 '16 at 19:56
  • Thank you @lauda :) It helped –  Aug 10 '16 at 20:05

1 Answers1

0

You can add one more arguments as --disable-extensions in your chrome options as below :-

ChromeOptions options = new ChromeOptions();
options.AddArguments("--disable-popup-blocking","--disable-extensions");
var basePath = AppDomain.CurrentDomain.BaseDirectory;
 Instance = new ChromeDriver(basePath, options);
  Instance.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
Saurabh Gaur
  • 23,507
  • 10
  • 54
  • 73