简体   繁体   English

如何使用C#中的硒自动在webrtc中单击“允许/阻止”按钮以弹出麦克风权限?

[英]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.

相关问题 Selenium C# 弹出窗口处理 - Selenium C# Pop-up handling 如何在不单击任何按钮并获得用户响应的情况下显示C#代码后面带有“是”和“否”选项的弹出窗口 - How to display Pop-up with Yes and No option from C# code behind without clicking any button and taking response from user 如何使用 C# 处理 Outlook 中的安全弹出窗口 - How to handle security pop-up in outlook using C# c# Selenium:无法切换到模态/弹出窗口/iFrame - c# Selenium: Unable to SwitchTo Modal/Pop-up/iFrame 如何使用以C#编写的Selenium在所需位置从弹出窗口下载并保存Excel和pdf文件 - How to download and save excel and pdf file from pop-up in a desired location using Selenium written in C# 我在C#中使用Selenium Webdriver,无法在证书弹出窗口中单击“确定” - I am using selenium webdriver in C#, I am unable to click ok in the certificate pop-up 通过C#中的API访问弹出窗口按钮 - Access pop-up window button via API in C# 在C#中创建弹出式表单 - Creating a Pop-Up form in C# Selenium C# 禁用 Microsoft Chromium Edge 浏览器同步弹出窗口 - Selenium C# to disable Microsoft Chromium Edge browser Sync pop-up 单击按钮以在.net c#Web应用程序中通过URL弹出新窗口 - Click on button to pop-up new window with passing URL in .net c# web application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM