Grant access to video and audio in Chrome 48 via Selenium Chromedriver automatically

前端 未结 3 1213
轻奢々
轻奢々 2020-12-22 04:15

I would like to automatically grant access to video and audio in Chrome via Chromedriver capabilities.

Based on this (pretty old) answer I tried the following:

3条回答
  •  佛祖请我去吃肉
    2020-12-22 04:35

    I think it needs to be site specific, the following works for me: prefs.put("profile.content_settings.exceptions.media_stream_camera.'https://somewebsite.com:443,'.setting", "1"); prefs.put("profile.content_settings.exceptions.media_stream_mic.'https://somewebsite.com:443,'.setting", "1");

    Also, I think the website needs to be in single quotes or it won't parse right.

    Give that a shot.

提交回复
热议问题