如何使用 Selenium 在 Edge 浏览器中启用“麦克风"访问? [英] How to enable 'Mircophone' access in Edge browser using Selenium?
问题描述
我知道您可以使用所需的大写字母传递各种标志/参数以启用对摄像头、麦克风等的访问.
I understand there are various flags/parameters you can pass using desired caps to enable access to camera, microphone, etc.
例如,在 Chrome 上,您可以使用 ChromeOption 并在prefs"下传递profile.default_content_setting_values.media_stream_mi".
For instance on Chrome you can use ChromeOption and pass 'profile.default_content_setting_values.media_stream_mi' under 'prefs'.
我希望在 Edge 浏览器上启用麦克风访问.我找不到任何相关信息.有人可以在这里帮助我吗?
I wish to enable the microphone access on Edge browser. I am not able to find any related information. Can somebody assist me here?
对于 Chrome,您可以启用此处提到的相同功能-
For Chrome you can enable the same like mentioned here-
推荐答案
您可以使用以下首选项在 Edge Browser 中启用摄像头、麦克风.
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);
希望对你有帮助!
这篇关于如何使用 Selenium 在 Edge 浏览器中启用“麦克风"访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!