Raven Raven - 1 year ago 221
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();

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download