Installation
Watir is a family of drivers for different browsers running on several operating systems. This page provides an overview of how to install the leading drivers on several operating systems, and also how to install a HTML Inspector.
Windows
Install Ruby
Install Ruby using the one-click installer for Windows. We recommend using Ruby 1.8.6-26 with Watir 1.6. More details.
Watir drivers are packaged as gems, Ruby libraries that can be installed over the internet.
Install Watir
Type these commands at a command prompt:
gem update --system
gem install watir
This installs drivers for both IE and Firefox (FireWatir).
Watir’s support for Firefox also requires a plugin.
If you run into trouble or are installing from behind a firewall, please see additional notes.
Mac
Check you have Ruby
Ruby is probably already installed on your machine. You can verify which version of Ruby is install by typing this command in a terminal window:
ruby -v
We recommend using Ruby 1.8.6 on all platforms.
Install Watir
Type these commands at a command prompt:
sudo gem update --system
sudo gem install firewatir
sudo gem install safariwatir
Watir’s support for Firefox also requires a plugin.
If you run into trouble or are installing from behind a firewall, please see additional notes.
Linux
Check you have Ruby
Ruby is probably already installed on your machine. You can verify which version of Ruby is install by typing this command in a terminal window:
ruby -v
We recommend using Ruby 1.8.6 on all platforms.
Install Watir
Type these commands at a command prompt:
sudo gem update --system
sudo gem install firewatir
Watir’s support for Firefox also requires a plugin.
If you run into trouble or are installing from behind a firewall, please see additional notes.
Install an HTML inspector
To use Watir effectively, you’ll need to be able to browse through the structure of your application’s HTML pages. These tools help you do that.
- On Firefox, use Firebug
- On Internet Explorer, use the IE Developer Toolbar









thank you it helps alot for me while learning watir…
fantastic tool for automation, i just loved it. thanks a lot
These commands require the command prompt to be run as Administrator in Windows 7:
gem update –system
gem install watir
A small adjustement to install process :
With Ruby 1.8.6, you have ruby gems 0.9.4, so “gem update –system” doesn’t work, you have to type “gem update”.
Thanks. You should update to the latest version of rubygems to work with the latest version of Watir: http://tinyurl.com/yg6wgsf
By the way, my advice is not a good one : “gem update” doesn’t make any error, but it doesn’t update to the latest version of rubygems either…
It looks like manual update of RubyGems (manual download + “ruby setup”) is the only way to get Watir on Windows with this 1.8.26 OneClick version.
Hi there,
I can’t update watir 1.5 ar 1.6,
I using Ruby
C:\Documents and Settings\Administrator>ruby -v
ruby 1.8.6 [i368-mswin32]
and watir 1.4.1
C:\Documents and Settings\Administrator>gem update –system
Updating RubyGems…
Attempting remote update of rubygems-update
Install required dependency builder? [Yn] Y
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find builder (>= 0) in any repository
Thanks,
Please find the answer to this problem on the Watir Wiki FAQ: http://tinyurl.com/yg6wgsf
To install devkit first, here is a reference, hope it helps
http://stackoverflow.com/questions/1718500/installing-hpricot-on-ruby-1-9-1-on-windows
If you get error while system update command..download the latest rubygems from http://rubyforge.org/frs/?group_id=126…and rerun the command..u wont get the error
Linux part need additional information. Not all Linux machines has ruby installed, and ruby -v will come with an error. Please ad the following two lines to Install Ruby and Rubygems:
sudo apt-get install ruby
sudo apt-get install rubygems
This will make this tutorial more complete and helpful.
Regards
Thabet
Why not put the Firefox 3.5+ plugin link on this page? It is listed on the openqa site here:
http://wiki.openqa.org/display/WTR/FireWatir+Installation#FireWatirInstallation-InstalltheJSSHFirefoxExtension
It would provide a cleaner installation for users getting introduced to your product and would not make it seem like the site is not maintained much, which is a red flag for open source projects being adopted by any professionals.
I did try to install WATIR with the recommended 1.8.6-26 windows one-click installer. But when I did:
> gem update –system
it threw an error:
————————————
ERROR: Error installing rubygems-update:
rubygems-update requires builder (>= 0)
————————————
I uninstalled and tried the 1.9.1 installer. That did not work either.
As a last option I tried 1.8.6-27 RC2 (http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe) and that worked fine. Atleast my WATIR installation appears to have gone through fine. I’m yet to create and run tests. Meanwhile I thought this could be useful for a few more folks who faced similar issues.
Good luck.
Cheers
Rajeev