2

I am new to Watir and I have this weird situation with AJAX based webapp. Application might render a notification window over the page. This notification is a JS based modal window. If I click or mouse-over the notification it vanishes.. So somewhere in my script I have:

@browser = Watir::Browser.new :firefox
...
notf = notification
notf.click if notf

and the method to get notification is this:

def notification
  if browser.div(:class => "popupContent").present?
    Notification.new(browser.div(:class => "popupContent"))
  end
end

Script is running fine with IE and Chrome but with Firefox I get after 60sec 'Timeout:Error' for the if statement.. When I changed code this way:

def notification
  begin
    browser.div(:class => "popupContent").wait_until_present(1)
    Notification.new(browser.div(:class => "popupContent"))
  rescue Exception 
    puts "timeout..."
  end
end

Chrome and IE work fine are working fine - just adding up 1 sec delay in case notification is not present.. But Firefox is still having 60sec timeouts in case notification is not present?!? What am I doing wrong - do I need to set/check some Firefox settings? I have this configuration: - Win7 OS with Firefox 17.0.1 - Ruby 1.9.3p125 - watir-webdriver (0.6.1) - selenium-webdriver (2.26.0)

Thank you for your help!

2
  • 2
    Can you try upgrading to the latest version of selenium-webdriver (2.27.2)? I had some problems with Firefox 17, that were resolved by the latest selenium-webdriver version.
    – Justin Ko
    Jan 7, 2013 at 3:39
  • Thanks Justin - that was it! You can also post this hint as an answer to my question and I will accept it..
    – tom
    Jan 7, 2013 at 9:22

1 Answer 1

1

As mentioned in the comments, the solution is to upgrade to the latest version of selenium-webdriver (2.27.2).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.