Red Squirrel Reflections
Dave Hoover explores the psychology of software development

Dave Hoover
dave.hoover@gmail.com

Categories
All [Atom]
Craftsmanship [Atom]
Dynamic [Atom]
Intersection [Atom]
Learning [Atom]
Links [Atom]
Polyglot [Atom]
Projects [Atom]
XP [Atom]
Old Blog

Obtivian Blogs

Andy Maleh
Colin Harris
Fred Polgardy
Jim Breen
Kevin Taylor
Todd Webb
Turner King
Tyler Jennings

Archives

March 2009 (1)
January 2009 (1)
December 2008 (1)
October 2008 (3)
September 2008 (1)
June 2008 (4)
April 2008 (3)
March 2008 (1)
February 2008 (1)
August 2007 (1)
July 2007 (1)
June 2007 (1)
May 2007 (4)
April 2007 (3)
March 2007 (5)
February 2007 (6)
January 2007 (6)
December 2006 (10)
November 2006 (5)
October 2006 (8)
September 2006 (8)
August 2006 (5)
July 2006 (12)
June 2006 (7)
May 2006 (5)
April 2006 (5)
March 2006 (4)
February 2006 (2)
January 2006 (5)
December 2005 (5)
November 2005 (3)
October 2005 (3)
September 2005 (6)
August 2005 (4)
July 2005 (7)
June 2005 (14)
May 2005 (6)
April 2005 (8)
March 2005 (9)
February 2005 (11)
January 2005 (16)
Old Archives

 

Thu, 13 Jul 2006

SafariWatir in development

If you haven't noticed, I'm a big fan of web testing tools like Selenium and Watir. As I prepared for my RailsConf talk (at RailsConf), surrounded by herds of Macs, I realized that Watir adoption in the Rails community was seriously not going to happen anytime soon without some cross-browser and cross-platform support. Without that support, I continue to recommend Selenium RC or Selenium on Rails to most Rails developers.

And yet I still find myself infatuated with Watir's dead-simple setup (gem install watir and you're done) and intuitive API. So ... <deep-breath/> ... inspired by the Mac-centric tendencies of most of the Rails frontrunners, I have launched the SafariWatir project on RubyForge. There's not very much there yet. You can open and close Safari, fill out text fields, click buttons and links, ask whether the page contains text ... oh, and you can click alert boxes.

I just discovered Apple's GUI Scripting integration with AppleScript, which makes it wonderfully easy to handle things that Windows makes incredibly difficult. (Apple provides GUI Scripting to facilitate universal access.) Watir (for IE) developers, you may want to look away, the following code could hurt...

tell application "System Events" to tell process "Safari"
	tell window 1
		if button named "OK" exists then
			click button named "OK"
		end if
	end tell
end tell
That's all it takes to click an alert button in AppleScript. I wrap that in Ruby-goodness and stick it behind the Watir API, and man, I think this project is going to just about write itself.

[/projects/watir] permanent link


powered by blosxom