Joel Pearson wrote in post #1083436:
> http://watirwebdriver.com/browser-popups/

This works when the main window is not closed, but sometimes when you 
close a window, the window is closed but a pop-up comes.

If I use the code given I get error:

Errno::ECONNREFUSED: No connection could be made because the target 
machine actively refused
it. - connect(2)
        from C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `initialize'
        from C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `open'
        from C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `connect'
        from C:/Ruby187/lib/ruby/1.8/timeout.rb:53:in `timeout'
        from C:/Ruby187/lib/ruby/1.8/timeout.rb:101:in `timeout'
        from C:/Ruby187/lib/ruby/1.8/net/http.rb:560:in `connect'
        from C:/Ruby187/lib/ruby/1.8/net/http.rb:553:in `do_start'
        from C:/Ruby187/lib/ruby/1.8/net/http.rb:542:in `start'
        from C:/Ruby187/lib/ruby/1.8/net/http.rb:1035:in `request'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriv
er/remote/http/default.rb:82:in `response_for'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriv
er/remote/http/default.rb:38:in `request'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriv
er/remote/http/common.rb:40:in `call'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriv
er/remote/bridge.rb:598:in `raw_execute'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriv
er/remote/bridge.rb:576:in `execute'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriv
er/remote/bridge.rb:207:in `getWindowHandles'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-webdriver-2.25.0/lib/selenium/webdriv
er/common/driver.rb:185:in `window_handles'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.1/lib/watir-webdriver/wind
ow.rb:119:in `locate'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.1/lib/watir-webdriver/wind
ow.rb:106:in `handle'
        from 
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.1/lib/watir-webdriver/wind
ow.rb:99:in `use'

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