How to enable 'Mircophone' access in Edge browser using Selenium?

回眸只為那壹抹淺笑 提交于 2021-02-08 08:50:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!