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!
如评论中所述,解决方案是升级到最新版本的selenium-webdriver(2.27.2)。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.