我正在研究机器人框架,在该框架中,我无法允许chrome相机允许从浏览器弹出。请对此提供帮助,否则代码会有所帮助。
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
答案 0 :(得分:3)
需要创建具有允许麦克风(--use-fake-ui-for-media-stream)的首选项的Webdriver
类似的问题解决方法在此处how to handle web based alert or pop ups in robot framework?
中进行了说明此处How do i allow Chrome to use my microphone programatically?说明了与Java或python相关的解决方案
代码段:
Chrome With Preferences
${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
&{SiteOptions} Create Dictionary last_used=${1470931206} setting=${1}
&{media_stream_mic} Create Dictionary https://www.google.nl:443,*=${SiteOptions}
${prefs} Create Dictionary profile.content_settings.exceptions.media_stream_mic=${media_stream_mic}
Call Method ${chrome_options} add_experimental_option prefs ${prefs}
Create WebDriver Chrome chrome_options=${chrome_options}
答案 1 :(得分:0)
$ {chrome_options} =评估sys.modules ['selenium.webdriver']。ChromeOptions()sys 调用方法$ {chrome_options} add_argument --use-fake-ui-for-media-stream 调用方法$ {chrome_options} add_argument --use-fake-device-for-media-stream 创建Webdriver Chrome别名= tab1 chrome_options = $ {chrome_options}