0

I am looking for Selenium command line options for Firefox to change the user directory. Basically, I am currently using the following command line option to change the user data directory in Chrome, and I am looking for a similar command line option for Firefox. I do not seem to be able to find it on the Internet. Any help regarding this would be greatly appreciated.

chromeOptions=["user-data-dir=C:\temp"]

Thanks.

s7_user
  • 15
  • 1
  • 9

1 Answers1

0

I don't have the answer, but I can throw out a resource that might help find it.

Here are various options in firefox

It seems possible that browser.cache.disk.parent_directory, or something similar to it, is the option that you would need to set.

Although I can't be sure, as I have never set these options via command line myself. I have always done it via something like this, though:

FirefoxOptions ff = new FirefoxOptions();
FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("browser.download.dir", "%path%");
profile.SetPreference("browser.download.folderList", 2);
profile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv,application/pdf,application/octet-stream,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
ff.Profile = profile;

Hope this helps more than no answer at all :)

Asyranok
  • 950
  • 1
  • 7
  • 17