title: Watir-Webdriver "Element is not currently visible" error after closing popup windows
body: <p>I'm using the latest versions of watir-webdriver and firefox to visit a website, close any popup windows that appear, and then click a link in the original window. 
  But I'm running into this error message 
  <strong>Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotVisibleError)</strong> after switching back to the original window and then clicking the link. This code works fine when it doesn't encounter any popup windows.</p>
  
  <pre><code>require 'rubygems'
  require 'watir-webdriver'
  
  
  browser = Watir::Browser.new :firefox
  
  browser.goto "http://www.artbracket.com"
  
  #wait for page to load
  browser.wait_until { browser.body.exists? }
  
  #close any popup windows
  while browser.windows.size &gt; 1
      browser.windows.each_with_index do |w, index|
          unless index==0 then w.close end        
      end
  end
  
  #switch back to first window
  browser.windows.first.use
  
  if browser.link(:href =&gt; /opensocial/i).exists? then browser.link(:href =&gt; /opensocial/i).click end
  </code></pre>
  
  <p>Any help is appreciated.</p>