SafariWatir

We are putting Watir on Safari. The original Watir (Web Application Testing in Ruby) project supports only IE on Windows. This project aims at adding Watir support for Safari on the Mac.

Current release: safariwatir-0.2.5

Prior to its 0.2.0 release, SafariWatir used AppleScript in `backticks` to drive the Safari web browser, resulting in sluggish performance. The 0.2.0 release leverages the rb-appscript project (Ruby Apple event bridge) and boasts a significant performance improvement. The 0.2.1 release ensures that onChange events are fired when text fields and select lists are changed. The 0.2.2 release keeps SafariWatir in step with rb-appscript 0.3.0. The 0.2.3 release added image support. The 0.2.4-5 releases fixed Safari 3 incompatibility. The 0.2.6 release incorporate some contributions from Kyle Campos.

Installation: gem install safariwatir

Screencast: Watch it execute the test suite!

Example:
require 'rubygems'
require 'safariwatir'

browser = Watir::Safari.new
browser.goto("http://google.com")
browser.text_field(:name, "q").set("obtiva")
browser.button(:name, "btnI").click
puts "FAILURE" unless browser.contains_text("software")

Get involved: Join the SafariWatir-general mailing list!


Brought to you by Dave Hoover, who also put Watir on Rails.