Chibimagic's Weblog

Selenium Server 2.0 on Mac OS X/Windows with custom Firefox path

Posted on: July 28, 2011

By default, Selenium Server looks for Firefox at /Applications/Firefox.app on Mac OS X and [Program Files]\Mozilla Firefox\firefox.exe on Windows. You can also run Selenium with browsers in non-default locations, as long as you specify the path to them.

The server-side configuration doesn’t seem to be documented anywhere, so I looked through the code to find the property to set: webdriver.firefox.bin

Mac OS X:
java -jar "[path to selenium server]" -Dwebdriver.firefox.bin="[path to Firefox.app]/Contents/MacOS/firefox-bin"

Example:
java -jar "/Applications/My Folder/selenium-server-standalone-2.2.0.jar" -Dwebdriver.firefox.bin="/Applications/My Folder/Firefox.app/Contents/MacOS/firefox-bin"


Windows:
java -jar "[path to selenium server]" -Dwebdriver.firefox.bin="[path to firefox.exe]"

Example:
java -jar "C:\Documents and Settings\MyUsername\Desktop\selenium-server-standalone-2.2.0.jar" -Dwebdriver.firefox.bin="C:\Program Files\Some Folder\Firefox\firefox.exe"

(of course, you can also use backslash to escape the paths instead of double quotes)

Advertisements

1 Response to "Selenium Server 2.0 on Mac OS X/Windows with custom Firefox path"

Thanks for this, really helped me out today!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: