Monday, July 8, 2013

How to install watir on Windows XP / 7 (32 bit) for IE Webapp testing

(1) Goto and download
Ruby 1.9.3-p429

(2) Download from
and extract to C:\Windows\

(3) install Ruby 1.9.3-p429 using Administrator
Choose Add Ruby executables to PATH and Associate .rb and .rbw
Install to say C:\Ruby193

(4) Double click and extract DevKit-tdm to say C:\Ruby193\DevKit

(5) Use Command Prompt (cmd.exe) and enter into DOS shell and run
cd C:\Ruby193\DevKit
ruby dk.rb init
ruby dk.rb install
gem install watir --no-ri --no-rdoc
# might have some errors after the last step
gem install nokogiri
gem install mini_magick -v 3.5
gem install watir --no-ri --no-rdoc
gem install watir-webdriver --no-ri --no-rdoc

(6) Use irb to test interative session on IE
require "watir"
browser =
browser.text_field(:name => 'q').set 'Watir Example'
browser.button(:name => 'btnK').click

require "watir-webdriver"
browser = :ie
browser.goto ''
browser.text_field(:name => 'entry.0.single').set 'Watir' => 'Watir').set

No comments: