Accept browser permission dialog with behat/mink

谁说我不能喝 提交于 2019-12-12 00:43:45

问题


I'm using Behat with Mink.

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:


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:

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.

(source)

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

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!



来源:https://stackoverflow.com/questions/20613828/accept-browser-permission-dialog-with-behat-mink

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!