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.