2

Can someone advise me on how to set the path for the firefox exe file in Selenium using C#? This is what I thought would help but there is no ctor taking in just the FirefoxBinary:

FirefoxBinary binary = new FirefoxBinary("~/lib/mozilla firefox/firefox.exe");
IWebDriver driver = new FirefoxDriver(binary); //not a valid constructor
3
  • public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile); Click F12 on FirefoxDriver and you can go into the class. Commented Feb 17, 2016 at 2:44
  • What do I set in the Firefox profile? Commented Feb 17, 2016 at 2:46
  • FirefoxProfile profile = new FirefoxProfile(); Or set null Commented Feb 17, 2016 at 2:49

1 Answer 1

2

try following code

//give exe path here
 var service = FirefoxDriverService.CreateDefaultService("~/lib/mozilla firefox/firefox.exe");
        var driver = new FirefoxDriver(service);

if any issue the let me know.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.