Watir issue with AutoIt on Vista 64 bit

J

Joe Dimauro

Installed Watir (v1.6.5) on top of Ruby (v1.8.6) on my 32bit WinXP and
64 bit Vista systems. Ran into way too many issues trying to use Ruby
1.9.1 (64-bit) and Watir(v1.6.5), so degraded to try these older
versions, as Watir site recommends.

Are versions of Watir (v1.6.5) and Ruby (v1.8.6) for Vista 64-bit
available? If so where?

This is the four line program that run OK on 32bit XP, but fails on 64
bit Vista.

require 'Watir'
browser=Watir::Browser.new
browser.minimize # Fails on this line
browser.close

Here's the irb session on the 64-bit Vista system:

C:\>irb
irb(main):001:0> require 'Watir'
=> true
irb(main):002:0> browser=Watir::Browser.new
=> #<Watir::IE:0x4c98a5c url="about:blank" title="">
irb(main):003:0> browser.minimize
WIN32OLERuntimeError: unknown OLE server: `AutoItX3.Control'
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
`initialize'
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:435:in
`set_window_state'
from
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:416:in
`minimize'
from (irb):3
irb(main):004:0> exit


FYI: Here's the output from gem's env command:
C:\>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
- INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mswin32-60
- GEM PATHS:
- C:/Ruby/lib/ruby/gems/1.8
- C:/Users/Me/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

Here's relevant definition from the Watir file: ie-class.rb

414 # Minimize the window (appears as icon on taskbar)
415 def minimize
416 set_window_state :SW_MINIMIZE
417 end


434 def set_window_state(state)
435 autoit.WinSetState title, '', autoit.send(state)
436 end
437 def autoit
438 Watir::autoit
439 end

Here's relevant definition from the Watir file: ie.rb:

108 def self.autoit
109 unless @@autoit
110 begin
111 @@autoit = WIN32OLE.new('AutoItX3.Control')
112 rescue WIN32OLERuntimeError
113 _register('AutoItX3.dll')
114 @@autoit = WIN32OLE.new('AutoItX3.Control')
115 end
116 end
117 @@autoit
118 end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,828
Messages
2,569,736
Members
45,518
Latest member
vlonesshirt

Latest Threads

Top