Installation

For being able to run automated tests using Watir you first need to install Ruby. The easiest way to install Ruby on Windows is to download Ruby installer package from http://www.rubyinstaller.org.

After that you need to install the Watir gem. If you are installing behind a proxy, then you first have to set the HTTP_PROXY environment variable:

set HTTP_PROXY=http://username:password@your.proxy.com:80

After that you just need to run following command to install Watir:

gem install watir

This will install drivers for both IE and Firefox. Firefox also requires a jssh plugin for Watir. Links for installing the plugin can be found from http://watir.com/installation.

If you also want to run tests against Google Chrome. Then you also need to install the watir-webdriver gem: 

gem install watir-webdriver

Now just start to write and run your Watir test scripts :)

If you get some complains about not finding Watir when trying to run your script. Try to set following environment variable:

set RUBYOPT="rubygems"  

Some more information about the RUBYOPT parameter can e.g. be found from here.

NOTE! That you should run all the above commands with Administrator privileges.