in Accessibility, Ruby, Testing

A new version of the Ruby Accessibility Analysis Kit

This is to announce that RAAKT (The Ruby Accessibility Analysis Kit) has been updated. This release includes more accessibility tests and an initial mapping of tests to the Unified Web Evaluation Methodology (UWEM). Also, thanks to Derek Perrault RAAKT now uses Hpricot to parse the HTML document. This solves the problem where the previous parser (RubyfulSoup) declared a class “Tag” that was likely to clash with your local classes in Rails.

To install the new version simply type gem update raakt or gem install raakt if you have a previous version installed.


Summary of changes from version 0.4 to version 0.5.1.

  • Example of how to use RAAKT in Watir unit tests.
  • Tests for area element alt attribute.
  • UWEM mapped in comments for relevant test methods.
  • Test to check that input fields of type image have an alt attribute with text.
  • Refactoring of some methods for more compact syntax. Patch by Derek Perrault.
  • Added test to verify that fieldsets have legends.
  • Fixed alt_to_text that needed to check element type before attempting to read attribute value.
  • Fixed language attribute check (downcased value). Added iso language code list.
  • Applied patch from Derek Perrault (better use of Hpricot features).
  • Fixed check for lang attribute (now requires a value as well).
  • Test for charset mismatch in http headers and document meta element.
  • Switch to Hpricot. Patch by Derek Perrault.

An article on the value of, and how to integrate basic accessibility tests in your development process is in the works for In the meantime check out the Raakt wiki.

If you are using Watir it is very simple:

require 'watir'
require 'raakt'
require 'test/unit'

class TC_myTest < Test::Unit::TestCase
	attr_accessor :ie

	def setup
		@ie = Watir::IE.start("")

	def test_startPagePassesBasicAccessibilityCheck
		#set up the accessibility test and pass html to raakt
		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)
  1. I used the online RAAKT checker and noticed that the reported code checked looked like . A quick check of my own code showed that I had not included that strange ‘meta=””‘ attribute. A further check of the code listing revealed the same effect with the and tags as well. There may be others; I didn’t look beyond the first thirty or so lines. I, of course, cannot tell if the problem is in the parsing or the reporting, but something needs to be fixed.

  2. You were using the previous (0.4) version of raakt. That version relied on the RubyfulSoup parsing library. This apparently introduced some strange markup behaviour from time to time. The current version relies on Hpricot which seems to be much more stable.

    I just updated the online interface so you should be able to retest your page again.

  3. Hi…i was trying to use “Raakt’..i have downloaded the Raakt 0.5gem and i have tried to use the same script to run which is posted on the page “” ….but it is unable to find ther any way i can monitor the webpage….

    pls do mail me on my mail id ….

Comments are closed.