Raven Raven - 23 days ago 11
C# Question

How to use existing Firefox profile in Selenium C#?

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();


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