Watir: Another sweetspot for Enterprise Ruby
There are many speculations regarding Ruby (the programming language) and it’s ready-ness for enterprise use. The other day, a colleague of mine found an absolutely sweet spot: Automated testing via the browser interface.
Watir stands for “Web Application Testing in Ruby”, you write a few lines of Ruby that fires up Internet Explorer, and then clicks around, fills in form fields, submits, etc.
My colleague used a couple of hours to write a few lines to integration test a complex system for a financial customer. He modified it to repeat the same test in three different environments and via timers found out that one of the environments performed very badly.
I saw my colleague demo it yesterday, and both testers and developers present were absolutely impressed by the jar-dropping demo. Comments: “We could have used this much earlier”, “Despite that I don’t know Ruby, It’s easy to understand what it does”. Everybody in the project room went around smiling (David Heinemeier would probably say “happy”)
It’s nothing new that automated browser testing can be done, but when I ask about the alternatives, I’m told that they’re too complex to get started with, and sometimes take forever to set up.
Watir gets started with just four lines of code:
[code lang=”ruby”]require ‘watir’
require ‘watir/WindowHelper’
include Watir
ie = IE.new
ie.goto(test_site) [/code]
In my opinion, Watir + Ruby is a winnner. So easy to get started. So great payoff for a small amount of time invested. Jaw-dropping reactions on developers and testers that don’t even know Ruby. It’s a definite winner.
Technorati Tags: ruby, enterprise, business case, watir
July 18th, 2006 at 09:53 (GMT-1)
Hi!
Selenium is also easy and good.
http://www.openqa.org/selenium/
+
http://jameleon.sourceforge.net/
http://sahi.sourceforge.net/
Heiko
July 22nd, 2006 at 21:14 (GMT-1)
You should also check out Scott Hanselman’s WatirMaker. It is a recording program for generating runy scripts for Watir automatically. It is written in C# and is Windows-only. But a Ruby version has also been made.
July 22nd, 2006 at 21:17 (GMT-1)
“runy script” – argh! :) Should have been “Ruby”
July 22nd, 2006 at 21:48 (GMT-1)
Thanks for the comments.
After spending some more time working with Watir, this is great news that you can record them. Thanks for letting me know, I’ll look into that first thing Monday morning!
August 3rd, 2006 at 13:42 (GMT-1)
I found an old post at my blog, almost a complete mirror of these sentiments.
As a lone consultant, I had to celebrate its genius alone. :-)
November 20th, 2007 at 21:12 (GMT-1)
[…] What’s Watir? Read “Watir: Another sweetspot for Enterprise Ruby” […]