0

Here is the Sample code:

    System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver.exe");
    DesiredCapabilities capabilities = DesiredCapabilities.chrome();

//this line of code added to disable extension but still getting the alert capabilities.setCapability("chrome.switches", Arrays.asList("--disable-extensions"));

    WebDriver driver = new ChromeDriver(capabilities);

How to disable this extension alert in mobile emulation mode?

If I add the below code,mobile emulation is not showing:

ChromeOptions options= new ChromeOptions();

options.addArguments("--disable-extensions");

How to disable this alert in mobile emulation mode using Selenium webdriver?

Madhuri Haritha
  • 357
  • 1
  • 4
  • 13
  • Possible duplicate of [ChromeDriver - Disable developer mode extensions pop up on Selenium WebDriver automation](http://stackoverflow.com/questions/23087724/chromedriver-disable-developer-mode-extensions-pop-up-on-selenium-webdriver-au) – Saurabh Gaur Oct 06 '16 at 17:31

1 Answers1

0

Try this...

ChromeOptions chop =  new ChromeOptions();
chop.addArguments("--disable-extensions");
WebDriver driver = new ChromeDriver(chop);
Grasshopper
  • 8,908
  • 2
  • 17
  • 32