With regard to closing all IE windows, something I unearthed this week is that sometimes Watir is a little too quick. What do I mean? Well, when some of the windows close in our sites, the application throws a 'Are you sure you want to leave?' window. I tried a bunch of different ways to attach that window to a new object and then close it - to no avail. So what I did stumble on was putting Watir to sleep for a little - let the window pop - try to attach and then close it.
Something like this in a teardown method:
def teardown
@ie.close
sleep 2
@ie_pop = IE.attach(:title, "Some Title")
@ie_pop.close
end
You can also wrap that with a begin/resuce/end statement to catch any exceptions if there are cases where the window doesn't pop.
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general