def check_for_popups
      autoit = WIN32OLE.new('AutoItX3.Control')
      #
      # Do forever - assumes popups could occur anywhere/anytime in your
      # application.
      loop do
        # Look for window with given title. Give up after 1 second.
        ret = autoit.WinWait('Windows Internet Explorer', '', 1)
        #
        # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).
        if (ret==1) then
          autoit.Send('{enter}')
        end
        #
        # Take a rest to avoid chewing up cycles and give another thread a go.
        # Then resume the loop.
        sleep(3)
      end
    end
def check_for_popups
      autoit = WIN32OLE.new('AutoItX3.Control')
      #
      # Do forever - assumes popups could occur anywhere/anytime in your
      # application.
      loop do
        # Look for window with given title. Give up after 1 second.
        ret = autoit.WinWait('Windows Internet Explorer', '', 1)
        #
        # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).
        if (ret==1) then
          autoit.Send('{enter}')
        end
        #
        # Take a rest to avoid chewing up cycles and give another thread a go.
        # Then resume the loop.
        sleep(3)
      end
    end
= Popup

 Start background thread to click popup windows
  Warning:
    Make browser window active
    Don't mouse your mouse to focus other window during test execution