Using a custom Firefox profile when running Selenium tests

Posted on March 26th, 2010 by David Luhman and tagged .

If you use Selenium for testing web interfaces, you'll probably want to create a custom Firefox profile for use by Selenium. To me, the main reasons for this are to provide more screen real estate (remove toolbars etc.) and to speed up browser loading.

But it's a little tricky to get Selenium to find your saved profile.

Here's a great link for this :

Here are the highlights, for a Linux/Ubuntu user :

Start Firefox from the command line and create and save your custom profile :

  • $ firefox.exe -ProfileManager

Your start-selenium-rc.bash script (or however you start Se-RC server) should look like this :

!/bin/bash

java -jar /opt/selenium/selenium-server-1.0.1/selenium-server.jar -firefoxProfileTemplate /home/you/.mozilla/firefox/SeleniumProfile

SeleniumProfile is the directory you created when you created your custom profile.

Important! You may get a warning about new extensions that Selenium "injects" into Firefox. Enter this FF config option to get rid of this :

From address bar, enter "about:config" and add the following by right-click anywhere on the page and selecting "new"

  • extensions.newAddons (type=boolean; value=false)