Filipin.eu

Željko Filipin's blog.
Home Blog Tags License

View on GitHub
12 January 2010

Watir on WebDriver

by Željko Filipin

Update!

Instructions on this page are obsolete. Please find up to date detailed instructions for Windows, Mac and Linux in my watir book.

Jari Bakken just released Watir on WebDriver.

Windows

One-Click Installer (old)

On Windows, install it with

gem install watir-webdriver

and use it with

require "rubygems" # optional
require "watir-webdriver"
browser = Watir::Browser.new(:firefox)

Supported browsers are Internet Explorer (:ie, :internet_explorer), Firefox (:ff, :firefox), Chrome (:chrome) and RemoteWebDriver Server (:remote).

RubyInstaller

Install RubyInstaller, DevKit and all required gems and it just works!

gem install watir-webdriver

Mac

My Mac came with Ruby and RubyGems installed, so it was just:

sudo gem install watir-webdriver

Linux

Ubuntu

My Ubuntu did not have Ruby and RubyGems installed.

Install Ruby with:

sudo apt-get install ruby-full

You can install RubyGems with:

sudo apt-get install rubygems

but Jari said it would be better to install it from source. Downland the latest RubyGems tgz or zip file (rubygems-1.3.5.tgz and rubygems-1.3.5.zip at the moment), extract it, open Terminal in extracted folder and run:

sudo ruby setup.rb

Install watir-webdriver:

sudo gem1.8 install watir-webdriver<br />

Fedora

Please see Installing Watir-Web Driver on Fedora Linux

tags: code - ruby