王博天
unread,Jan 6, 2009, 10:31:17 AM1/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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