From: Joel Pearson Date: 2012-10-06T04:30:43+09:00 Subject: Re: How can I catch browser error in watir-webdriver? Use something along these lines to record the types of error and simulate them. Once you have the exact error reported, like "end of file reached", you can rescue that error by using rescue like a case statement: http://rubylearning.com/satishtalim/ruby_exceptions.html ______________________________________ require 'watir-webdriver' begin b = Watir::Browser.new 10.times { b.goto "www.google.com" sleep 5 #Close or disconnect the browser here #and see what error message you get b.goto "about:blank" } rescue puts "Your error message was: #{$!}" exit ensure b.close rescue nil end ______________________________________ -- Posted via http://www.ruby-forum.com/.