Add support for Watir ( in Rails.
Ruby Logos
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
gemfiles Fix syntax errors. Really. Nov 2, 2013
lib/watir Bump version for a new release. Jun 15, 2016
spec Stub logger for puma Dec 3, 2015
.gitignore Initial commit Aug 25, 2012
.travis.yml Update .travis.yml to run specs against newest stable Ruby versions. Jun 15, 2016
.yardopts Bump version for a new release. Jun 15, 2016
LICENSE Add yard documentation. Browser#goto accepts now https and about:blan… Jan 3, 2013 Update Aug 18, 2016
Rakefile Run specs before actually releasing. It seems that Bundler has change… Jul 22, 2015
watir-rails.gemspec Drop mime-types dependency. It works fine in Rails 4. Closes #13 Jul 22, 2015


Gem Version Build Status Coverage

This gem makes Watir work with Rails.


Add this code to your Gemfile:

group :test do
  gem "watir-rails"


Just use Watir like you've always done in your requests/integration tests:

browser =
browser.goto home_path
browser.text_field(name: "first").set "Jarmo"
browser.text_field(name: "last").set  "Pertman"
browser.button(name: "sign_in").click

Ignore Rails Exceptions

By default, exceptions raised by Rails application will be re-raised in your tests making them to fail.

This feature is only enabled when config.action_dispatch.show_exceptions is set to false in your Rails configuration.

You can disable it in watir-rails by ignoring exceptions:

Watir::Rails.ignore_exceptions = true


  • When using Rails path/url helpers in your tests then always use path instead of url methods, because latter won't work!