selenium 2.0b3 中的 Firefox 4 确认对话框 [英] Firefox 4 confirmation dialog in selenium 2.0b3
问题描述
我已经使用 selenium 大约 3 个月了.我的测试在 Firefox 3.6 中运行良好.但是,当我更新到 Firefox 4 和 selenium-server 2.0b3 时,确认对话框出现问题.
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.
代码如下(很简单):
choose_ok_on_next_confirmation
click("delete_button")
get_confirmation
wait_for_page_to_load
我进行了很多搜索并尝试了许多其他东西,例如 assert_confirmation 或 store_confirmation.甚至 is_confirmation_present
也没有用.他们无法检测到我认为的对话.
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.
我降级到 Firefox 3.6 并且运行良好.
I downgraded to firefox 3.6 and it worked fine.
有人知道原因吗?我不太了解 Firefox 4 的工作原理.而且我还得向我的伙伴解释这个问题.
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.
推荐答案
page.evaluate_script('window.confirm = function(){
return true;
}')
作品
这篇关于selenium 2.0b3 中的 Firefox 4 确认对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!