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.
e65e5fc4-6020-4479-84aa-fb6637b425cf|2|3.0
Tags:
Errors | Watir
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
8a41579b-c1bb-490e-8e53-98d4ea702853|0|.0
Tags:
Watir