How can I catch browser error in watir?
You need to look up Ruby error handling.
This is from rubylearning.com:
puts ‘I am before the raise.’
raise ‘An error has occured.’
puts ‘I am after the raise.’
puts ‘I am rescued.’
puts ‘I am after the begin block.’
To use this with watir’s errors, you just place your code within a
begin/rescue/end block, or you can use rescue within a method, like
puts “Main method”
raise “I am an error”
puts “I’m after the error”
puts “Rescued an error”