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