Skip to content

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.

Tip: While updating RubyGems, you can use
gem update --system --no-rdoc --no-ri
instead of
gem update --system.

It will be much faster, but you will not install RDoc and ri.

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.

Install RubyGems

Make sure you have latest rubygems version 1.3.5 or above. Type the following command at command prompt

gem -v

If the version is less than 1.3.5, install the latest version from RubyForge
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

If you are using Windows 7 or Vista, make sure you run the above commands with Administrator privileges.
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

You can Watir on a Mac by using either FireWatir, or SafariWatir, but not Watir itself because it has IE requirements.

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

To prepare Ruby for Watir installation, type this command at a command prompt:

sudo gem update --system

To install the Firefox driver:

sudo gem install firewatir

Watir’s support for Firefox also requires a plugin.

To install Safari driver, install Xcode for Mac-only Development. It is 751.1 MB and you have to be registered as an Apple Developer, but the registration is free.

Type this command at a command prompt:

sudo gem install rb-appscript
sudo gem install safariwatir

If you run into trouble or are installing from behind a firewall, please see additional notes.

linuxLinux

Check you have Ruby & RubyGems

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
gem -v

We recommend using Ruby 1.8.6 on all platforms. If any of above command results in error, please install ruby and ruby gems using the following commands:

sudo apt-get install ruby
sudo apt-get install rubygems

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.

TroubleShooting

Visit the following links for having trouble with installation:

46 Comments leave one →
  1. uma mahesh varma permalink
    November 25, 2009 10:56 am

    thank you it helps alot for me while learning watir…

  2. December 7, 2009 12:06 pm

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

    • सुनील माथुर permalink
      April 15, 2010 6:07 am

      HI Aniket,
      I am new to Watir tool, I need to implement for the upcoming project.
      Please provide me some documentation to start with the tool.

      Regards
      Sunil Sharma

  3. December 12, 2009 9:41 am

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

  4. Tristan permalink
    December 13, 2009 2:44 pm

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

    • December 19, 2009 5:04 am

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

      • Tristan permalink
        December 19, 2009 11:28 am

        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.

        • Kevin permalink
          July 1, 2010 8:06 pm

          I was able to run

          gem install rubygems-update
          update_rubygems

          from the command prompt. This was from the rubygems 1.3.7 readme.

  5. Xiao Hui permalink
    December 23, 2009 10:02 am

    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

  6. Sridhar permalink
    December 28, 2009 6:53 pm

    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. thabet permalink
    January 11, 2010 5:27 pm

    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. Michael Sharkey permalink
    January 19, 2010 5:07 pm

    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. January 20, 2010 6:01 am

    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

    • Krishnamurthy permalink
      February 17, 2010 6:10 am

      Thank you for the last option link to install the Ruby. This worked fine with updates also. Couple of files failed to update (ruby-opengl – Error installing ruby-opengl – Failed to build gem native extension. Rest of installing files went well.

      Thank you once again.

  10. sam permalink
    February 13, 2010 4:34 pm

    Please update instructions to reflect the fact that on GNU/Linux rubygems may not be installed, even if ruby is. On some GNU/Linux systems rubygems must be installed separately. If rubygems isn’t installed already then the stated commands will not work.

  11. Simon permalink
    March 18, 2010 2:58 pm

    Is there a mac plugin for Firefox 3.6?

    • March 19, 2010 11:41 am

      Simon, thanks for the reminder, I have added link to Mac plugin for Firefox 3.6 to the page.

  12. Paolo permalink
    March 23, 2010 7:54 am

    I cannot install JSSH on Firefox 3.6.
    Is there a Linux plugin for Firefox 3.6?

    Thanks!

    Paolo.

  13. April 4, 2010 9:39 pm

    When I go to the X-Code page on the Apple Developer site, I’m only finding the X-Code for Snow Leopard. I have OS X 10.5 Anyone know where that version of X-Code is?

    • April 6, 2010 8:11 am

      I would suggest that you post this question to an Apple forum, I think you will get a faster reply there.

  14. May 9, 2010 10:53 pm

    Has anyone modified jssh to work with FF3.6 yet?? I keep getting a segmentation fault whenever I try.

    Thanks!

  15. Jim Showalter permalink
    May 19, 2010 8:18 pm

    I followed the instructions to install ruby and gems, including getting the latest gems (1.3.7 at the time of this writing), but when I execute gem -v it says 0.9.4 and the instructions say it must be at least 1.3.5. Why does 1.3.7 gems say it is 0.9.4 gems?

  16. Andrew permalink
    July 23, 2010 5:59 pm

    Section about installing Ruby Gems could use more detail in my opinion. Other than that, very helpful.

    • Andrew permalink
      July 23, 2010 6:00 pm

      Find it slightly odd that such an old version of Ruby is still recommended, just me? Keep in mind I know nothing about Ruby.

      • July 28, 2010 8:26 am

        Some Watir features require that specific Ruby version (support for some pop ups if I remembered it correctly). I am using newer version of Ruby and everything works fine for me.

    • July 28, 2010 8:27 am

      Andrew, what should we add to rubygems?

  17. chethan permalink
    August 4, 2010 12:29 pm

    Hi All,

    I was facing Gem update problem with ruby186-26.exe installer, After lot of trail & error ruby186-27_rc2.exe is working fine for me. Pls update the same in the site.

    Thanks every one for helping me.
    Chethan

Trackbacks

  1. Watir Powered LoadRunner Scripts « Altentee | Performance & Test Automation Specialists
  2. Unit testing in Watir – marthijn.
  3. Using WATIR for Browser Based Testing « Rails, etc.
  4. Creative QA
  5. Tweets that mention Installation « Watir -- Topsy.com
  6. WTANZ 07 – Web page automation with Ruby / Watir « RamsThoughts
  7. WTANZ07: Watir basics « testkeis

Leave a Reply

Note: You can use basic XHTML in your comments.

Subscribe to this comment feed via RSS