def check_for_security_alerts
      autoit = WIN32OLE.new('AutoItX3.Control')
      loop do
        ["Security Alert", "Security Information"].each do |win_title|
          ret = autoit.WinWait(win_title, '', 1)
          if (ret==1) then
            autoit.Send('{Y}')
          end
        end
        sleep(3)
      end
    end
def check_for_security_alerts
      autoit = WIN32OLE.new('AutoItX3.Control')
      loop do
        ["Security Alert", "Security Information"].each do |win_title|
          ret = autoit.WinWait(win_title, '', 1)
          if (ret==1) then
            autoit.Send('{Y}')
          end
        end
        sleep(3)
      end
    end
Check for "Security Information" and "Security Alert" alert popup, click 'Yes'

 Usage: For individual test suite

 before(:all) do
  $popup = Thread.new { check_for_alerts }
  open_in_browser
  ...
 end

 after(:all) do
   close_browser
   Thread.kill($popup)
 end

 or for all tests,
  $popup = Thread.new { check_for_alerts }
  at_exit{ Thread.kill($popup) }