require 'rubygems'
require 'watir' # the watir controller
require 'watir/windowhelper'
require 'win32ole'
def check_for_popups
autoit = win32ole.new('autoitx3.control')
loop do
ret = autoit.winwait("选择 -- 网页对话框", "", 1)
puts ret
if (ret==1) then
autoit.winactivate("[class:internet explorer_tridentdlgframe]", "")
autoit.send("{tab}")
autoit.send("{tab}")
#autoit.send("湖州")
#autoit.send("{asc 2709}")
#autoit.sendunicode("a")
#autoit.clipput ("杭")
#autoit.clipget
#autoit.tooltip "this is a tooltip杭州", 0, 0
#autoit.sleep 2000
unknown ole server: `autoitx3.control' (wi2oleruntimeerror)
that might mean you have not resisted the autoitx3.dll in your computer,
in current watir version, autoitx3.dll has been included in the watir folder,
so run the command in "run":
regsvr32 "c:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\lib\watir\autoitx3.dll"
then you will not get the errors