Firefox 4 confirmation dialog in selenium 2.0b3
Asked Answered
E

2

1

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.

Endo answered 9/4, 2011 at 1:52 Comment(0)
C
0

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

Cristobal answered 11/4, 2011 at 12:58 Comment(2)
Thank you :D. I think I will downgrade to 3.6.Endo
Full support for FF4 will be in Selenium 2.0RC1Thessa
A
0
page.evaluate_script('window.confirm = function(){ 
      return true; 
}') 

works

Aulos answered 24/10, 2012 at 19:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.