no such file to load -- watir/ie (LoadError)

by pietman 16. November 2010 13:22

getting the following ruby error?

no such file to load -- watir/ie (LoadError)

solve as follows:

gem update --system
gem install watir

then try running your ruby file again.

 

Tags:

Errors | Watir

watir and file uploads resolved

by pietman 12. October 2010 17:46

Trying to run the following Ruby test script under Watir:
(This should simply open a webpage and select a file for upload)

require 'watir'
require 'test/unit'
require 'watir/windowhelper'

b = Watir::Browser.new
b.goto("http://localhost:65519/data/UploadHIVData.aspx")
b.file_field(:name, "ctl00$MainContent$FileUpload1").set("c:\\test\\here.txt")
assert_equal "c:\\test\\here.txt", b.file_field(:name,"ctl00$MainContent$FileUpload1").value
exit

But it fails with the following error:

>ruby GRASP_Upload_File.rb
C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/windowhelper.rb:44:in `check_autoit_installed': The AutoIt dll must be correctly registered for this feature to work properly (Watir::Exception::WatirException)
    from C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/input_elements.rb:492:in `set'
    from GRASP_Upload_File.rb:16
>Exit code: 1

Here is my Solution (tested and working):

gem update
gem install autoit

rem - goto your installation folder e.g.
cd C:\Program Files\Ruby\lib\ruby\gems\1.8\gems\watir-1.6.6\lib\watir

regsvr32 AutoItX3.dll

got the following confirmation message:

DllRegisterServer in AutoItX3.dll succeeded.

clicked ok and it all works after that

Tags:

Watir

About ...

pietman celliersPietman Celliers
Bitlink  Ltd
bitlinkit.com