如何点击 SeleniumIDE 中的嵌入式警报?
HTML 中有代码(不是我的页面)
<script>
alert('1');
</script>
我如何使用 Selenium IDE 测试它(单击警报)???
我尝试了这个问题的答案单击里面的“确定”按钮警报(Selenium IDE),但它不起作用。
In HTML there is the code(its not my page)
<script>
alert('1');
</script>
How can I test it with Selenium IDE (click the alert) ???
I tried answers from this question Click in OK button inside an Alert (Selenium IDE) but it does not work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Selenium IDE 当前不处理警报。有一个 有关处理警报和提示的能力的未决问题;不幸的是,它已经开放了相当长一段时间(自 2007 年万圣节以来),因此您最好的选择是将测试分为两部分,一部分在警报之前,另一部分在警报之后,然后手动关闭警报。
Selenium IDE does not currently handle alerts. There is an open issue concerning the ability to handle alerts and prompts; unfortunately it's been open for quite some time (since Halloween 2007), so your best bet is to split your test into two parts, one before the alert and one after it, and dismiss the alert manually.
你不能,抱歉。
alert
是一个模式框,不能通过可编程性关闭,它需要用户交互(这是设计使然)You cannot, sorry.
alert
is a modal box that cannot be programmability dismissed, it requires user interaction (which is by design)有许多功能可以帮助您处理警报/提示/确认。以下是我发现的一些:
There are a number of functions that help you deal with alerts/prompts/confirmations. Here are a few that I found: