Maybe you could try looking at the source code on the page which is 
triggering the popup. It might be a different trigger.

Regardless, provided each window was spawned from this webdriver session 
then the windows close loop should get them all. As long as you do it 
before terminating the webdriver session itself.

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