4
votes

enter image description here

I want to click block. I tried this:

alert = browser.switch_to_alert()
alert.dismiss();

However it says that there is no alert open. I think it's not considered as an alert?

1

1 Answers

2
votes

To get rid of the Microphone/Camera popup you can use the following arguments from ChromeOptions Class:

  • Java solution:

    ChromeOptions options = new ChromeOptions();
    options.addArguments("allow-file-access-from-files");
    options.addArguments("use-fake-device-for-media-stream");
    options.addArguments("use-fake-ui-for-media-stream"); 
    WebDriver driver = new ChromeDriver(options);