The following will guide you on how to install Watir and other related components in a way that will help you achieve fast and data driven development of Watir Scripts. All things written below are already available on the internet. I just consolidated them in one post:

OS:Windows Vista
Browser: IE 7

  • Install Ruby
Watir is basically a Ruby library. In order for Watir to run, you have to install Ruby first. You can install ruby directly by downloading the binary here:

  • Install Watir Library
With ruby installed, you can install Watir as follows:

1. Go to the command prompt
2. Type the following command:
gem install Watir
  • Install a database Driver

You will need a database driver to interface Watir scripts with your desired database. This is necessary to create data pools and to save testing results in a DB repository. There are stable drivers for MS SQL and MySQL databases. Install the MS SQL driver as follows:

1. Go to the command prompt
2. Type the following command:

gem install sequel

3. Follow the instructions.

For MySQL database, you can use the Ruby/MySQL driver which can be installed as follows:

1. Download the latest version of Ruby/MySQL from this page
2. Extract the zipped file ruby-mysql-0.2.6.tar.gz
3. Run the following command from within the extracted folder.:

ruby setup.rb

4. Follow the instructions.

  • Install WatirRecorder++

WatirRecorder++ is not essential to develop Watir scripts, but it substantially saves the time needed to develop scripts. Watir Ruby scripts can be written manually, which means that the automation developer needs to write user actions one by one. This can be time consuming, so WatirRecorder++ can help. It is also a free windows application, which was developed by Scott Hanselman, an engineer at Microsoft. It listens to user actions in Internet Explorer and converts them into Watir Ruby scripts

You can download WatirRecorder++ here:
Once installed, you can start using it immediately and it’s very easy to use and self explanatory. Just fire the recorder and Internet explorer will start listening to your actions and converting them to a ruby script in real time.

  • Install IE Developer ToolBar
Internet Explorer Developer Toolbar helps speed developing Watir automated scripts. It helps you identify various properties of html objects in fast visual user friendly fashion. You can identify any html attribute by clicking on it.

You can download IE Toolbar here:

Now you're ready to begin automating your tests with ruby.