selenium 2.0b3 中的 Firefox 4 确认对话框
我已经使用硒工作了大约三个月。我的测试在 Firefox 3.6 中运行良好。但是,当我更新到 Firefox 4 和 selenium-server 2.0b3 时,确认对话框出现问题。
这是代码(非常简单):
choose_ok_on_next_confirmation
click("delete_button")
get_confirmation
wait_for_page_to_load
我已经搜索了很多并尝试了许多其他东西,例如assert_confirmation或store_confirmation。甚至 is_confirmation_present
也不起作用。他们无法检测到我认为的对话。
我降级到 firefox 3.6,效果很好。
有人知道原因吗?我不太了解 Firefox 4 的工作原理。而且这个问题我还是得给我的伙伴解释一下。
I have worked with selenium for like 3 months. My tests worked fine in Firefox 3.6. However, when I update to Firefox 4 and selenium-server 2.0b3, there is a problem with the confirmation dialog.
Here is the code (very simple):
choose_ok_on_next_confirmation
click("delete_button")
get_confirmation
wait_for_page_to_load
I have searched a lot and tried many other things like assert_confirmation or store_confirmation. Even is_confirmation_present
didn't work. They can't detect the dialog I think.
I downgraded to firefox 3.6 and it worked fine.
Anybody know the reason? I don't know much about how Firefox 4 work. And I still have to explain this problem to my partner.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,Selenium 问题跟踪器中有几条评论证实了此问题 - http ://code.google.com/p/selenium/issues/detail?id=27 ,我自己的经验也表明了这一点。
这个问题的原因不是特定的 Selenium 版本,它可能与 Firefox 4 对话框机制的一些变化有关,较旧的 1.x 系列的 Selenium 也不起作用。
目前,您有两种方法可以选择:
WebDriver 可与 FF4 配合使用,但在处理 iframe 发出的警报和提示时仍然存在问题。当然,它仍然是测试版,所以切换到它会有风险,你的伴侣可能也不喜欢这个;)
Yes, there are several comments in Selenium issue tracker that confirm this problem -- http://code.google.com/p/selenium/issues/detail?id=27 , and my own experience shows the same.
The reason of this issue is not a specific Selenium version, it is probably related to some changes in Firefox 4 dialog mechanics, older Seleniums of 1.x series don't work too.
At the moment, you have two ways to go:
WebDriver works with FF4, but still have problems with handling alerts and prompts issued from iframes. And of course it is still beta so there would be risky to switch to it, your partner may not like this either ;)
作品
works