如何在机器人框架中访问麦克风(摄像头)? [英] How to access microphone(camera) in robot framework?

查看:57
本文介绍了如何在机器人框架中访问麦克风(摄像头)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究机器人框架,其中我无法允许 chrome 相机允许从浏览器弹出.请对此提供帮助,否则代码会很有帮助.

I am working on robot framework where in i am not able to allow chrome camera allow popup from the browser. Please help on this or code will help a lot.

推荐答案

需要创建带有允许麦克风的首选项的 webdriver (--use-fake-ui-for-media-stream)

Need to create webdriver with preferences which allows microphone (--use-fake-ui-for-media-stream)

这里解释了类似的问题解决方案如何在机器人框架中处理基于网络的警报或弹出窗口?

Similar question solution is explained here how to handle web based alert or pop ups in robot framework?

Java 或 python 相关解决方案在此处如何做我允许 Chrome 以编程方式使用我的麦克风吗?

Java or python related solution explained here How do i allow Chrome to use my microphone programatically?

片段:

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}

这篇关于如何在机器人框架中访问麦克风(摄像头)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆