接受贝哈特/貂浏览器对话框中的权限 [英] Accept browser permission dialog with behat/mink

查看:181
本文介绍了接受贝哈特/貂浏览器对话框中的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用贝哈特与水貂。

目前我正在为建设WebRTC技术的测试。问题是WebRTC技术具有其中用户必须选择他们想要分享他们的媒体浏览器的权限对话框。由于此权限是从浏览器本身,而不是HTML的,我不知道如何与貂皮接受它,甚至如果可能的话。

Currently I'm working on building a test for webrtc. The issue is that webrtc has a browser permission dialog where the user has to select that they do want to share their media. As this permission is from the browser itself instead of html I don't know how to accept it with mink or even if that's possible.

是否有任何变通或标准溶液的呢?我想同样的问题对于任何一个浏览器需要用户权限才能使用也是如此。

Is there any work around or standard solution for this? I imagine the same issue holds true for anything a browser requires user permissions to use.

推荐答案

选项1:这感觉就像有点的大锤牛刀,但最主要的答案,我能找到的是与像自动执行此的AutoIt

Option 1: It feels like a bit of a "sledgehammer to crack a nut", but the main answer I can find is to automate this with something like AutoIt:

您必须prepare这样的AutoIt,它等待任何浏览器下载对话框,在其中硒放弃的地步,作为窗口的控制,保存文件,并关闭窗口。之后,硒可以照常继续。

You have to prepare AutoIt such, that it waits for any browser download dialog, the point at which Selenium is giving up, takes control of the window, saves the file, and closes the window. After that Selenium can continue as usual.

我还没有尝试过这个自己,所以不能给出更详细的答案,我害怕。

I've not tried this myself, so can't give a more detailed answer, I'm afraid.

选项2:您可能会认为你可以只需设置有问题的浏览器始终接受这些请求,但长相像此设置可能不会影响硒(至少不是浏览器,关于Firefox不知道)。如果你能弄清楚为什么这是 - 或者,如果它在FF工作 - ,这可能是一个简单的修复

Option 2: You might think that you could simply set up the browser in question to always accept those requests, but it looks like this setting may not affect Selenium (at least not with Chrome, not sure about Firefox). If you could figure out why that was - or if it does work in FF -, that might be a simpler fix!

这篇关于接受贝哈特/貂浏览器对话框中的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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