I suppose you could always wrap a "rescue true" around each of your
assertions.  There are different ways of doing this.  This is just off the
top of my head but I'm pretty sure it works because I've done something
similar in the past.

One way would be:

def assertButton
  assert($ie.button(:caption, "Click Me").enabled?)  rescue true
end


If you have other commands that are likely to fail (e.g. a navigate link
command when the link isn't there), then you could wrap the rescue for the
whole method like this:

def assertButton
  assert($ie.button(:caption, "Click Me").enabled?)
rescue
  true
end

Where the "rescue" and "true" are the last lines before the "end" of the
method.  This will exit the method nicely and allow you to go to the next
method.  There are a lot of neat things you can do with a container like
this at the end of a test method.  If you want more information about
recovering from methods like this you should check out the "Programming
Ruby" book, second edition.

Hope this helps.  Paul C.


On 10/04/07, watir-user wrote:


Hi Charley,

Can you tell me how to overcome the same in Watir 1.4.1. Its not only
related to assertions, the problem i am facing is if the method which i am
calling if does not execute for some reason the  next step of the code does
not executes in the called method. So, is there any other way to over come
this problem in Watir 1.4.1?

Any suggestions  most welcome

Thanks,

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to