just_add_watir | Advanced recipes for Watir
24Jul/08Off

Q. How do I add a generic script timeout?

A. Use the Timeout class ...
Example watir:

Timeout::timeout(10)do
  begin
      @b.goto(url)
  rescue Timeout::Error
      puts 'Page took longer than 10 seconds to load'
  end
end
Tagged as: 1 Comment