Installing Firewatir on Mac OSX
12 June, 2008 – 6:14 pmBy now you’ve probably heard of watir or Web Application Testing In Ruby, a great automation framework which supports Microsoft Internet Explorer, and recently came in at number 3 as a popular oss tool on this blog.
I’ve been using this tool mostly from a windows box, and knew of the firefox equivalent, aptly named ‘Firewatir’ which is currently a Google code project. The beauty of this version, is that it allows you as a tester to explore functionality on your favourite platform for development, as I like to leave windows at work, and take OSX with me on the train.
Read on for some simple instructions in getting this running on your Macbook Pro …
Install the latest gem for firewatir using terminal
sudo gem install firewatir
Download the latest browser extension (XPI) for JSSh from here:
http://firewatir.googlecode.com/files/jssh-darwin-0.94.xpi
I found the easiest way to install it on a Mac is to open up Firefox, then just drag the .xpi file across to the browser. You’ll then be prompted with the usual in order to install the extension. You can also check for updates at the main Google code page.
Once installed, restart Firefox and enable the JSSh plugin from the Tools->JSSh configuration

You need to tick the checkbox that enables JSSh to listen in on port 9997
You should now be able to telnet to that port from a terminal
telnet 127.0.0.1 9997
ctrl-] to quit the shell and type quit to exit telnet
Allow popups for firefox by setting preferences->content as follows

Run the unit tests that come with your firewatir gem, typically:
cd /Library/Ruby/Gems/1.8/gems/firewatir-1.1.1/unittests/
ruby mozilla_all_tests.rb
This will take a couple of minutes after which you should get something similar to the following:
251 tests, 1414 assertions, 0 failures, 2 errors
Note: I get a couple of errors in attaching to new windows as per the following
1) Error:
test_simply_attach_to_new_window_using_title(TC_NewWindow):
FireWatir::Exception::NoMatchingWindowFoundException: Unable to locate window, using title and Pass Page
./../firewatir.rb:410:in `attach'
./unittests/attach_to_new_window_test.rb:16:in `test_simply_attach_to_new_window_using_title'
2) Error:
test_simply_attach_to_new_window_using_url(TC_NewWindow):
FireWatir::Exception::NoMatchingWindowFoundException: Unable to locate window, using url and (?-mix:pass\.html)
./../firewatir.rb:410:in `attach'
./unittests/attach_to_new_window_test.rb:24:in `test_simply_attach_to_new_window_using_url'
which at this stage I’m not overly concerned with as I’m not using that functionality. I’ll post an update if I resolve that for my system.









2 Responses to “Installing Firewatir on Mac OSX”
i got the same errors running ruby mozilla_all_tests.rb
By Philip Woeber on Jul 2, 2008
Thanks koops. Best resource online to isntall firewatir.
Champ.
By Sameh on Jul 25, 2008