My favorites | Sign in
Project Logo
       
Search
for
Updated May 05, 2009 by simon.m.stewart
FirefoxDriver  
Information about the Firefox Driver

Firefox Driver

Everything you ever wanted to know about the Firefox driver but were afraid to ask. See below for instructions on how to install the FirefoxDriver.

Before Going Any Further

The FirefoxDriver contains everything it needs in the JAR file. If you're just interested in using this driver, then all you need to do is put the webdriver-firefox.jar on your CLASSPATH, and WebDriver will do everything else for you.

If you want to dig deeper, though, carry on reading!

Important System Properties

The following system properties (read using System.getProperty() and set using System.setProperty() in Java code or the "-DpropertyName=value" command line flag) are used by the FirefoxDriver:

Property What it means
webdriver.firefox.bin The location of the binary used to control firefox.
webdriver.firefox.profile The name of the profile to use when starting firefox. This defaults to webdriver creating an anonymous profile
webdriver.firefox.useExisting Use a running instance of firefox if one is present

Normally the Firefox binary is assumed to be in the default location for your particular operating system:

OS Expected Location of Firefox
Linux firefox (found using "which")
Mac /Applications/Firefox.app/Contents/MacOS/firefox
Windows %PROGRAMFILES%\Mozilla Firefox\firefox.exe

The default profile name is WebDriver (the casing matters!)

Installing a Downloaded Binary

The "wedriver-firefox.zip" which may be downloaded from the website, contains all the dependencies (including the common library) required to run the FirefoxDriver. In order to use it:

  1. Copy all the "jar" files on to your classpath.

Installing the Quick Way From Source (with Ruby)

If you're doing development work, the test suites are arranged in such a way as to use the version of webdriver found in firefox/src/extension

This assumes that your installation of Firefox 2 or 3 is pretty standard. On Windows, this means that it should be installed in the default location ("C:\Program Files\Mozilla Firefox") and on the Mac under "/Applications/Firefox". On Linux, it is assumed that firefox is available on the default PATH. If your firefox is installed in a custom location, then open up the SingleTestSuite and add a system property to tell the firefox driver where your Firefox binary is:

System.setProperty("webdriver.firefox.bin", "d:\\apps\\mozilla firefox\\firefox");

Pros

Cons


Comment by mir...@neodonis.com, Jan 07, 2009

I just installed Firefox v3.0.5 and then installed Firefox WebDriver? in the default Firefox profile. It doesn't seem to work properly when SSL is involved.

When Webdriver opens a secure URL, the "Secure Connection Failed" error page is displayed. If I paste manually the same URL in the browser address bar it works fine. My test fails with "org.openqa.selenium.NoSuchElementException?: Unable to locate element using //a[@href=...".

Maybe someone can answer.

Thanks, Mircea

Comment by simon.m.stewart, Jan 08, 2009

For technical help and advice, please go to the project home page and click on the "General support and discussion" link.

Comment by simon.m.stewart, Jan 08, 2009

@mircea: It sounds like you're attempting to connect to a page that doesn't have a valid SSL certificate. This is covered by issue #116. Please "star" that issue to follow it!

Comment by mir...@neodonis.com, Jan 08, 2009

Thanks, Simon. That's exactly what happened. I tested in a local/intranet QA environment where we use self signed certificates. I've read the issue you mentioned and starred it.

Comment by mir...@neodonis.com, Jan 09, 2009

I didn't know how to set a system property. By reading Webdriver issues I found that other people had that "small" problem. I suggest to add a few line to this very page to document that. Below are two alternatives to set same property: System.getProperties().put("webdriver.firefox.useExisting", "true"); System.setProperty("webdriver.firefox.useExisting", "true");

Comment by vir.booster, Aug 06, 2009

Hi Everyone! I want to know if there is any way to remove the language configuration from the driver because I'm testing i18n in a webapp and I really need no language in the Tools>Options>Content>Select a language to add. How can I do this? Thanks in advance!!

Comment by simon.m.stewart, Aug 06, 2009

The best place to ask for help is the Google Group: https://groups.google.com/group/webdriver


Sign in to add a comment
Hosted by Google Code