Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99408

Can't use existing Firefox profile in Selenium WebDriver using C#

$
0
0

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 -pbefore. 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

Viewing all articles
Browse latest Browse all 99408

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>