I had a problem like this before and the workaround I used was to kick
off a thread that checked something in the browser every so often to
make sure that it wan't stuck. In my script I did something like this:

def check_for_freeze(browser)

# Kick off a new thread and keep checking the url
Thread.new do
      while
        sleep(30)
        first_url = browser.url
        sleep(300)
        second_url = browser.url

        if (first_url == second_url)
          puts "The browser got stuck and had to be refreshed." # you
can put this in your test log instead if you want.
         browser.refresh
        end

end


Of course this is a workaround so you have to be careful if you do
something like this. For instance in this example if the URLs match by
coincidence it will refresh the browser even though nothing is wrong.
You could work around this by adding more checks and only refreshing
if it's the same five times in a row or something like that.

Brian

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to