a problem about AutoItX3.Control

223 views
Skip to first unread message

王博天

unread,
Jan 6, 2009, 10:31:17 AM1/6/09
to watir-...@googlegroups.com
HI:
    I want to test a dialog.rb function ,my test program as follow:
    require 'watir'
require 'watir/dialog'
require 'test/unit'

class Dialtest < Test::Unit::TestCase
 
  include Watir
 
  def setup
     $browser=IE.new
      $browser.goto   'file:///C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/unittests/html/JavascriptClick.html'
   
  end
 
  def teardown
   
  end
 
  def test_dialog
    puts "hello\n"
    $browser.button(:id, 'btnAlert').click_no_wait
    puts dialog
    sleep 3 # FIXME: need to be able to poll for window to exist
   
    dialog.button("OK").click
  end
 
end

when I run this script , a error occred:
          1) Error:
test_dialog(Dialtest):
WIN32OLERuntimeError: unknown OLE server: `AutoItX3.Control'
    HRESULT error code:0x800401f3
      无效的类别字符串
    c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/dialog.rb:34:in `initialize'
    c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/dialog.rb:34:in `new'
    c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/dialog.rb:34:in `click'
    dialogtest.rb:26:in `test_dialog'

1 tests, 0 assertions, 0 failures, 1 errors

   please tell me how to handle the problem? thanks

Al Snow

unread,
Jan 6, 2009, 11:05:18 AM1/6/09
to Watir General

Tony

unread,
Jan 8, 2009, 1:33:35 AM1/8/09
to Watir General
AutoIt dll has not been registered.
If you register this dll and try running the script should work.
try running the below on cmd...
c:\ regsvr32 C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
AutoItX3.dll

Should fix the issue.....

-Tony
Reply all
Reply to author
Forward
0 new messages