Reputation: 123
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!
Upvotes: 2
Views: 733
Reputation: 46826
As mentioned in the comments, the solution is to upgrade to the latest version of selenium-webdriver (2.27.2).
Upvotes: 1