简体   繁体   中英

Accept request to microphone in Chrome using selenium

I'm writing selenium tests python using webdriver and my test cases require access to user media (microphone). I tried different variations of --disable-user-media-security flag but couldn't achieve what I want. I'm doing something this:

chrome_options = Options()
chrome_options.add_argument("--disable-user-media-security")
self.driver = webdriver.Chrome('/Users/xxx/Develop/WebME/chromedriver', chrome_options=chrome_options)
driver = self.driver

Any ideas on how to handle this? There must be some way to do get access to mic :/

对于麦克风,将此选项添加到 chrome:

chrome_options.add_argument("--use-fake-ui-for-media-stream")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM