Firefox 4 confirmation dialog in selenium 2.0b3

别来无恙 提交于 2019-12-02 03:21:01

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:

  1. downgrade to an earlier version of Firefox,
  2. migrate to a new Selenium 2.0 API (aka WebDriver)

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 ;)

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

works

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!