From: Joel Pearson Date: 2012-11-09T00:18:48+09:00 Subject: Re: Closing popups watir-webdriver 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/.