[英]How to automate the clicking of 'Allow/Block' button in webrtc for microphone permission pop-up using selenium in C#?
I'm trying to automate the event of clicking at 'Allow/Block' permissions of microphone in webrtc using Selenium. 我正在尝试使用Selenium自动在webrtc中单击麦克风的“允许/阻止”权限。 Since these pop-up alerts are not a part of browser elements, so clicking through XPath would not work. 由于这些弹出警报不是浏览器元素的一部分,因此无法通过XPath单击。 So I tried to automate it by using the keyboard shortcuts to Allow/Block microphone, selecting the Allow/Block buttons by Tab key and pressing Enter. 因此,我尝试使用键盘快捷键“允许/阻止”麦克风,按Tab键选择“允许/阻止”按钮并按Enter来使其自动化。
Actions action = new Actions(driver);
action.SendKeys(OpenQA.Selenium.Keys.Tab).Perform();
action.SendKeys(OpenQA.Selenium.Keys.Enter).Perform();
But SendKeys does not work. 但是SendKeys不起作用。 Is there any other way to interact with these alert buttons? 还有其他与这些警报按钮互动的方法吗?
Have you checked the AutoIt for interacting with non html content? 您是否检查了AutoIt与非html内容的交互?
https://www.autoitscript.com https://www.autoitscript.com
Autoit is a useful scripting tool where you can automate simple actions in windows platform. Autoit是一个有用的脚本工具,您可以在其中自动执行Windows平台中的简单操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.