An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Selenium, ant and Snow Leopard

December 17, 2009 ·

With the arrival of my new 27" iMac, I'm now doing all my development on Snow Leopard and that caused a problem today with my automated Selenium tests... I use ant to drive Selenium to launch Firefox to run UI-based test suites. It's pretty slick and I'll blog about it soon. Unfortunately, on Snow Leopard, Selenium cannot launch Firefox from the command line (due to a security exception caused by a library mismatch it seems). Myself and Peter Bell have been looking for a workaround for this for a few days and even started looking at the alpha builds of Selenium 2.0 which claim to resolve this (but we couldn't figure out how to drive those builds from ant). Some Googling turned up Matt Patterson's blog post with a simple workaround. The root of the problem is the dynamic library load path in the environment and his workaround is simply to use a shell script wrapper that removes the environment! Then you can specify browser="*chrome path/to/selenium-firefox" with your shell script in the selenese ant task and you're off to the races.

Tags: tdd

2 responses

  • 1 Adam Goucher // Dec 17, 2009 at 8:05 PM

    You could also use Sauce RC ( which has the fix for the Snow Leopard problem built right in.
  • 2 Martijn van der Woud // Dec 18, 2009 at 12:15 AM

    "I use ant to drive Selenium to launch Firefox to run UI-based test suites."

    Sounds interesting! At we use HtmlUnit (a headless Java browser) to perform blackbox system tests. HtmlUnit is awesome, but it would be nice to learn a little bit more about Selenium's capabilities. What do you recommend as a good place to start reading/exploring?