====== Using Raakt in Watir ====== [[http://www.openqa.org/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 Ruby library that works with Internet Explorer on Windows. Since Watir drives an instance of Internet Explorer it is very easy to test pages that use AJAX or other techniques to dynamically render content. To use Raakt in Watir, first [[:install|install the Raakt gem]]. Adding basic accessibility tests in Watir is easy: require 'watir' require 'raakt' require 'test/unit' class TC_myTest < Test::Unit::TestCase attr_accessor :ie def setup @ie = Watir::IE.start("http://www.peterkrantz.com") end def teardown @ie.close end def test_startPagePassesBasicAccessibility #set up the accessibility test raakttest = Raakt::Test.new(@ie.document.body.parentelement.outerhtml) #run all tests on the current page result = raakttest.all #make sure raakt didn't return any error messages assert(result.length == 0, result) end end