Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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

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

1 Answer 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

share|improve this answer
add comment

Your Answer

 
discard

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.