I need to use an existing Firefox profile in Selenium using C#. That profile has a configured add-on that i need.
I found some code googling but those were for Java, I tried the following code but it still doesn't work.
FirefoxProfile profile = new FirefoxProfile("C:\\Users\\username\\Desktop\\software\\Files");
driver = new FirefoxDriver();
Firefox profiles include custom preferences that you would like to simulate an environment for your test script. For example, you might want to create a profile that sets preferences to handle the download popup programmatically during your test run.
Selenium IDE by Selenium Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests.
FireFox was fully supported only in previous versions i.e. v47 and earlier. Selenium WebDriver version 2.53 is not compatible with Mozilla FireFox version 47.0+. After v47. 0, FireFox is provided with GeckoDriver.
In new versions works this method
1) Go to firefox profile selection option
2) Create profile
FirefoxProfile profile = new FirefoxProfileManager().GetProfile("axixa");
FirefoxOptions options = new FirefoxOptions();
options.Profile = profile;
IWebDriver firefox = new FirefoxDriver(options);
I found the answer on the official docs of selenium
var profileManager = new FirefoxProfileManager();
FirefoxProfile profile = profileManager.GetProfile("Selenium");
IWebDriver driver = new FirefoxDriver(profile);
Source: Selenium docs
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