Some kind Ruby Enthusiasts built a tool called Watir (Web Application Testing in Ruby) which basically allows you to programmatically control a web browser (Specifically Microsoft Internet Explorer). From a Software Quality Assurance standpoint this allows the developers to automate much of what is typically a manual process.
However, IE is not the only browser in the world (and if I had my way it would be eliminated from the face of the earth), and thus has has grown related projects Such as FireWatir which runs Firefox instead of IE.
Last summer's google summer of code involved some refactoring of the Watir code to work more uniformely with FireWatir (and I believe the safari equivalent as well -- although I haven't used that so I can't confirm). Anyways, the process of using watir/firewatir is pretty simple. First, setup your requires/includes
#may not need rubygems if your system is setup right require 'rubygems' require 'watir' require 'firewatir' include FireWatir
Then you do
browser = Watir::Browser.new #instead of browser = Watir::IE.new
For more information on Watir::Browser check this page:
http://wiki.openqa.org/display/WTR/Browser.new
Unfortunately it doesn't appear the RDocs have been updated to include Watir::Browser
This all works great on windows (who would have guessed), but I've been having trouble setting up Firefox to work with Firewatir in Ubuntu 8.10 linux. I've used several different JSSH extensions that are supposedly compatible with FF on linux (and they appear to install just fine). Those extensions can be found here:
http://wiki.openqa.org/display/WTR/FireWatir+Installation
and here:
http://www.valibuk.net/2008/11/jssh-firefox-30-with-optional-port-number/
Neither seem to work though. I've tried just about everything I can think of, but I can never get telnet to connect to port 9997 after I've loaded the extension into firefox (and restarted, and setup firefox preferences according to tutorials found
here
and
here
and several others. But nothing, I always get the following error when attempting to do either Firefox.new or Watir::Browser.new :
Watir::Exception::UnableToStartJSShException: Unable to connect to machine : 127.0.0.1 on port 9997. Make sure that JSSh is properly installed and Firefox is running with '-jssh' option
I have yet to come up with a working solution, however I'm in the process of building firefox from source and enabling jssh in the build (which should solve the problem).
The build process I've essentially stolen from the firefox build process documentation and utilized from:
http://ubuntu-snippets.blogspot.com/2008/07/build-firefox-3-web-browser-...
and
https://developer.mozilla.org/En/Simple_build
Basically, I pull the source code with hg (mercurial), and use the newer build process documented on the mozilla site, while creating a .mozconfig file as noted in the other tutorial. The one change I had to make to the .mozconfig was I removed the webservices extension since it doesn't seem to be avaiable anymore (I was getting an error when I left it).
Anyways, if anyone has got JSSH working with ubuntu 8.10 I'd love to know how you did it.
Check back often as I shall report with news of whether or not this is working fairly soon.
--- Follow Up --3/22/2009
After finding out that selenium can now be used without using server side javascript code directly I switched to that. I'm now using that with cucumber and have come up with some cool ways of automating tests in multiple browsers. Check back soon, I should have a blog with some details on my setup.
--- Follow Up --4/30/2009
I just posted a new blog Testing Multiple Browsers with Selenium and Cucumber. Check it out.

In the same boat
I was originally using cucumber with selenium, but ran into some odd behavior.
I'd read that watir works at a COM level, rather than seleniums javascript injection.
This sounded better.
Unfortunately, none of the jssh plugins work with firefox 3.0.13.
I could build my own firefox, but given the poor state of the documentation and lack of a working plugin, I'm thinking I'm best safer sticking with selenium.
JSSH and ubuntu 8.10
Thanks for this really helpful post! I can report that I was able to get JSSH working in ubuntu 8.10, running on my laptop. I can also report that I'm not able to do the same, but with another instance of 8.10 running on a desktop. I think this has to do with the fact that I am running ubuntu 32bit on the laptop, and 64bit on the desktop.
On the laptop, I found that installing a firefox plugin for JSSH worked right away. On the other hand, neither the same plugin, nor building firefox from scratch with JSSH enabled worked on the desktop. I also could never get telnet to connect to port 9997 on the 64bit system. I suspect reinstalling 32bit ubuntu on the desktop would do the trick...
With JSSH running on the 32bit machine, I was able to use your post to start scripting some regression testing that was previously a manual slog. And that is great! Thanks again.