简体   繁体   English

如何使用硒在弹出窗口中接受警报?

[英]How to accept alert in the popup window using selenium?

When the pop-up window opens, the alert is directly throwing.当弹出窗口打开时,警报是直接抛出的。 When I check the page source, it comes empty but when I click OK or hit enter.当我检查页面源时,它是空的,但是当我单击“确定”或按 Enter 键时。 The page source is coming.页面源码来了。 I tried to switch alert and accept, selenium did not see the alert.我尝试切换警报并接受,硒没有看到警报。 I tried to send the Enter key to any element of the pop-up window, it still didn't work.我尝试将 Enter 键发送到弹出窗口的任何元素,它仍然不起作用。 I am not forgetting to switch the pop-up window.我没有忘记切换弹出窗口。 How can I switch that alert?我怎样才能切换那个警报?

弹出窗口

driver.switchTo().alert().accept();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用硒警报处理弹出确定消息接受 - how to handle popup ok message accept with selenium alert Selenium:接受弹出提示后如何返回上一页? - Selenium:How to return to the previous page after accept the alert popup? 如何使用Python在Selenium中测试Alert / Popup - How to test Alert/Popup in Selenium using Python 使用selenium webdriver在弹出窗口中显示处理警报 - Handling alert appears in a popup window using selenium webdriver Selenium 关闭/接受 Chrome 确认弹出窗口 - Selenium dismiss/accept Chrome confirmation popup window 如何在python中接受带有硒的弹出窗口 - How to accept a popup with selenium in python 检测网站是否限制浏览其网站,直到您接受警报或弹出窗口-在python中使用Selenium Webdriver - Detect if a website is restricting navigating their site until you accept alert or popup - using selenium webdriver in python 如何处理硒中的警报窗口 - How to handle alert window in selenium 如何在不使用 alert.accept() 的情况下使用 Selenium 在 Brave/Chrome 中禁用弹出窗口/警报? - How to disable popups/alerts in Brave/Chrome using Selenium without using alert.accept()? 处理“全部接受”(cookie)弹出窗口 - 在 Python 中使用 Selenium - Handling “Accept All” (cookies) popup - Using Selenium in Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM