Skip to content

Instantly share code, notes, and snippets.

@miebach
Created July 7, 2012 18:50
Show Gist options
  • Save miebach/3067644 to your computer and use it in GitHub Desktop.
Save miebach/3067644 to your computer and use it in GitHub Desktop.
Watir on windows
Watir installation on windows
(following more or less https://github.com/zeljkofilipin/watirbook/blob/master/installation/windows.md )
1) go to http://rubyinstaller.org/downloads and downloaad latest RubyInstaller and the "development kit"
2) Execute RubyInstaller, installing to c:\Ruby - add to path -> yes
3) Unpack devcelopment kit to c:\Ruby\devkit
4)
gem update --system
cd c:\Ruby\devkit
ruby dk.rb init
ruby dk.rb install
rem #gem install watir --no-ri --no-rdoc
gem install watir-webdriver --no-ri --no-rdoc
5) RSpec http://rspec.info/
gem install rspec
Example from http://watir.com/frameworks/#rspec :
require "rubygems"
require "rspec"
require "watir-webdriver"
describe "google.com" do
let(:browser) { @browser ||= Watir::Browser.new :firefox }
before { browser.goto "http://google.com" }
after { browser.close }
it "should search for watir" do
browser.text_field(:name => "q").set "watir"
browser.button.click
browser.div(:id => "resultStats").wait_until_present
browser.title.should == "watir - Google Search"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment