Try it this way around

br=Watir::Browser.new :ie
br.goto(url)
br.windows.each {|w| w.close rescue nil}
br.close rescue nil



If you still get popups and they're triggered by JavaScript when leaving 
the page, you might be able to do this before closing:
 br.execute_script("window.onbeforeunload = null")

-- 
Posted via http://www.ruby-forum.com/.