Can someone advise me on how to set the path for the firefox exe file in Selenium (C#).
I'm using the following code presently, however it is not working as hoped:
FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("webdriver.firefox.bin", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
IWebDriver driver = new FirefoxDriver(profile);
Any suggestions would be appreciated.
You should use FirefoxBinary instead of FirefoxProfile as below
FirefoxBinary binary = new FirefoxBinary(new File("path/to/binary"));
FirefoxOptions options = new FirefoxOptions();
options.setBinary(binary);
IWebDriver driver = new FirefoxDriver(options);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With