0
votes

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?

1

1 Answers

0
votes

Try this...

ChromeOptions chop =  new ChromeOptions();
chop.addArguments("--disable-extensions");
WebDriver driver = new ChromeDriver(chop);