Using Raakt in Watir

Watir is a free, open-source functional testing tool for automating browser-based tests of web applications. It is pronounced “water”. Watir is a family of Ruby libraries. They support Internet Explorer on Windows, Firefox on Windows, Mac and Linux, Safari on Mac, Chrome on Windows.

Since Watir drives an instance of a web browser it is very easy to test pages that use AJAX or other techniques to dynamically render content.

To use Raakt in Watir, first install the Raakt gem.

Adding basic accessibility tests in Watir for is easy (this example uses Internet Explorer):

require 'watir'
require 'raakt'
require 'test/unit'
class TC_myTest < Test::Unit::TestCase
  attr_accessor :ie
  def setup
    @ie = Watir::IE.start("")
  def teardown
  def test_startPagePassesBasicAccessibility
    #set up the accessibility test
    raakttest =
    #run all tests on the current page
    result = raakttest.all
    #make sure raakt didn't return any error messages
    assert(result.length == 0, result)
frameworks/watir.txt · Last modified: 2009-01-26 13:54 by peterkz
Recent changes RSS feed, Powered by DokuWiki