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.

windowsWindows

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.

macMac

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.

linuxLinux

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.

14 Responses leave one →
  1. 2009 November 25
    uma mahesh varma permalink

    thank you it helps alot for me while learning watir…

  2. 2009 December 7

    fantastic tool for automation, i just loved it. thanks a lot

  3. 2009 December 12

    These commands require the command prompt to be run as Administrator in Windows 7:
    gem update –system
    gem install watir

  4. 2009 December 13
    Tristan permalink

    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”.

    • 2009 December 19

      Thanks. You should update to the latest version of rubygems to work with the latest version of Watir: http://tinyurl.com/yg6wgsf

      • 2009 December 19
        Tristan permalink

        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.

  5. 2009 December 19
    Help me! Error settings update watir permalink

    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,

  6. 2009 December 28
    Sridhar permalink

    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

  7. 2010 January 11
    thabet permalink

    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

  8. 2010 January 19
    Michael Sharkey permalink

    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.

  9. 2010 January 20

    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

Trackbacks & Pingbacks

  1. Watir Powered LoadRunner Scripts « Altentee | Performance & Test Automation Specialists

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS