3

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

private IWebDriver driver;

[SetUp]
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

  • which file it cannot find binary or profile? – frennky Aug 2 '11 at 14:53
1

Try

[SetUp]
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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