unknown OLE server: ‘AutoItX3.Control’ (WIN32OLERuntimeError)

Following error is displayed when we run the script,

>ruby test.rb
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie.rb:114:in `initialize': unknown OLE server: `AutoItX3.Control' (WIN32OLERuntimeError)
    HRESULT error code:0x800401f3
      Invalid class string
    from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie.rb:114:in `new'
    from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie.rb:114:in `autoit'
    from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:438:in `autoit'
    from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:426:in `bring_to_front'
    from test.rb:6
>Exit code: 1


Solution
You need to register AutoIt.

In a command window, navigate to the directory where you've put AutoIt and type:

regsvr32 AutoItX3.dll

My directory is C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/AutoItX3.dll.

Also can use below command to register AutoIt.

regsvr32 C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/AutoItX3.dll  (For Ruby 1.8.6)

regsvr32 C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/AutoItX3.dll  (For Ruby 1.8.7)

 

 

After the above action, I got the error message is as following,

The module "AutoItX3.dll" was loaded but the call to DllRegisterServer failed with error code 0x80070005.

image

 

Solution

Return code was: 0x80070005

If you are logged on with a user account that does NOT have administrative privileges, you will experience this behavior if the DLL file writes to the registry, or changes files in the %SystemRoot%/System32 folder.

To workaround this behavior, log on with an account that has administrative privileges.

image

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值