Friday, February 6, 2009

Setting Ruby/Watir Environment - Chapter 0

Chapter O: Checking where I was in the process of setting up the Ruby/Watir environment.

UNDER CYGWIN:


$ gem -v
1.3.1
NOTE: Had to add alias to .bashrc to get it to work.

$ type ruby
ruby is hashed (/cygdrive/c/deepdive/InstantRails-2.0-win/ruby/bin/ruby)

$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

$ cat two-minutes.rb
#!/cygdrive/c/DeepDive/InstantRails-2.0-win/ruby/bin/ruby
require "watir"
ie = Watir::Browser.new
ie.goto "http://www.google.com"
ie.text_field(:name, "q").set "WSO2 WSAS"
ie.button(:name, "btnG").click
ie.close
Worked.

UNDER CMD:

C:\Users\jasnow>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\Users\jasnow>gem -v
1.3.1

C:\cygwin\home\jasnow\RUBY>ruby two-minutes.rb
two-minutes.rb:3:in `require': no such file to load -- watir (LoadError)
from two-minutes.rb:3

Now start the Watir Unit Tests under Cygwin.

No comments:

Post a Comment