Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Firefox 5 is installed not at the default location. So, I tried with the following to create a FirefoxDriver:

private IWebDriver driver;

public void SetupTest()
    var ffBinary = new FirefoxBinary(@"D:\Program Files (x86)\Firefox 4\firefox.exe");
    var firefoxProfile = new FirefoxProfile(@"C:\Users\xyz\AppData\Roaming\Mozilla\Firefox\Profiles\2z4r45zq.default");
    driver = new FirefoxDriver(ffBinary, firefoxProfile);

But the FirefoxBinary instantiation throws an exception, stating that: "The system cannot find the file specified". But my firefox.exe is there. Also, I added it to my PATH. I saw some suggestion to use webdriver.firefox.bin in java environment. Is there any equivalent in .NET environment?

BTW, I am using Win 7(64), Firefox 5, Selenium 2 .NET webdriver. Thanks

share|improve this question
which file it cannot find binary or profile? – frennky Aug 2 '11 at 14:53


public void SetupTest()

 FirefoxProfile SeleniumProf = new FirefoxProfile(@"C:\location of your custom profile");
 driver = new FirefoxDriver(SeleniumProf);

You don't need to declare the binary. It works for me and I'm using FireFox 9 on Windows 7

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.