making things better, making better things

Wednesday, December 23, 2009

setting up browser automation with FireWatir

Ruby-based testing will only get you so far in the web development world – sooner or later you need to make sure your code works in a real browser. So for the last few years I’ve been occasionally trying to get a browser-based test automation tool running – often something in the Selenium family. It usually takes a full day for me to give up, usually because I just can’t get the tool to actually drive the browser.

Today I got FireWatir working! It wasn’t that hard, but I had to consult a few different web pages, so here it is all in one place.

  1. Via FireWatir Installation, install the gem:
    sudo gem install firewatir

    and the JSSh Firefox extension (Mac FF 3.5 version) to make Firefox steerable.

  2. Set up a Firefox profile, so you can run tests without all your weird extensions in play, and without messing with your personal browser session and history. Mine is called “tester”.
  3. Start up Firefox with JSSh and your new profile (you can do this while Firefox is running):
    /Applications/ -jssh -P "tester"
  4. In an irb session, try some stuff – for example, on a new Spree instance:
    ff =
    ff.goto 'http://localhost:3000/', 'Clothing').click

Voila! Now I want to try Cucumber and Watir.

posted by erik at 12:14 pm  

Friday, December 11, 2009

John Resig on JavaScript testing, performance analysis, and jQuery 1.4

John Resig, of jQuery and other fame, spoke tonight at the BayJax meetup in the Yahoo! cafeteria. His slides are probably online somewhere, but they are lucid, informative, illustrated with pictures and code samples, and written by someone who knows what he’s talking about, not to mention who was paying attention while writing them. (Update: Video on iTunes and not on iTunes.) If that’s not your bag, you’ll want to read my notes instead:

posted by erik at 11:39 pm  

Powered by WordPress