Željko Filipin's Blog on Software and Testing

Test like you do not need the money.

Archive for January, 2010

Watir on WebDriver

with 14 comments

Jari Bakken just released Watir on WebDriver.

On Windows, install it with

gem install selenium-webdriver
gem install watir-webdriver --pre

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

Update 1: as Steve suggested, I have tried it on RubyInstaller.

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

gem install selenium-webdriver
gem install watir-webdriver --pre
gem install win32-process

Update 2: It works on Mac.

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

sudo gem install selenium-webdriver
sudo gem install watir-webdriver --pre

Update 3: It works on Ubuntu Linux.

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 selenium-webdriver
sudo gem1.8 install watir-webdriver --pre

Written by Željko Filipin

January 12th, 2010 at 6:03 pm

Posted in Watir