selenium 2.0b3中的Firefox 4确认对话框 [英] Firefox 4 confirmation dialog in selenium 2.0b3

查看:204
本文介绍了selenium 2.0b3中的Firefox 4确认对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经和硒一起工作了3个月。 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的工作原理。我仍然需要向我的合作伙伴解释这个问题。

解决方案

  page.evaluate_script 'window.confirm = function(){
return true;
}')

工作


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.

解决方案

page.evaluate_script('window.confirm = function(){ 
      return true; 
}') 

works

这篇关于selenium 2.0b3中的Firefox 4确认对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆