I need to use a shared profile for Firefox, which doesn't get deleted on exit. Seems that this can be done using a FirefoxProfile
or FirefoxOptions
. But none of them seems to work: When starting the geckodriver, it uses a temp profile like this
1507646897935 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-profile" "C:\Users\\AppData\Local\Temp\rust_mozprofile.uzI9KAmLQ1zP"
When debugging, I noticed that the property ProfileDirectory
of the profile is always null.
var profileManager = new FirefoxProfileManager();
var profile = profileManager.GetProfile("Test");
var driver = new FirefoxDriver(profile);
The profile Test was created manually using firefox -p
before. I also tried to use it's location like this:
var profile = new FirefoxProfile(@"C:\Users\<MyUsername>\TestProfile", deleteSourceOnClean: false);
But same problem, can't figure out why this isn't working.
Used software
- geckodriver 0.19.0
- Selenium.Firefox.WebDriver 2.0.0 (NuGet)
- Selenium.WebDriver 3.6.0 (NuGet)
- ASP.NET Core 2.0