问题
I understand there are various flags/parameters you can pass using desired caps to enable access to camera, microphone, etc.
For instance on Chrome you can use ChromeOption and pass 'profile.default_content_setting_values.media_stream_mi' under 'prefs'.
I wish to enable the microphone access on Edge browser. I am not able to find any related information. Can somebody assist me here?
For Chrome you can enable the same like mentioned here-
How to allow or deny notification geo-location microphone camera pop up
回答1:
You can use the following preferences to allow camera, microphone in Edge Browser.
WebDriverManager.edgedriver().setup();
EdgeOptions options = new EdgeOptions();
options.setCapability("dom.webnotifications.enabled", 1);
options.setCapability("permissions.default.microphone", 1);
options.setCapability("permissions.default.camera", 1);
driver = new EdgeDriver(options);
Hope it helps you!
来源:https://stackoverflow.com/questions/54340679/how-to-enable-mircophone-access-in-edge-browser-using-selenium