0

I can use:

chromeOptions.AddUserProfilePreference("download.default_directory", downloadDirectory);

to set the default download directory, but I can't seem to figure out what the prefs key is for setting the default open file directory.

I tried looking for a list of all the possible preference keys.

1 Answers1

0

Example to automatically download a PDF with chrome :

var options = new ChromeOptions();
options.AddUserProfilePreference("download.default_directory", "c:\\Download");
options.AddUserProfilePreference("download.directory_upgrade", true);
options.AddUserProfilePreference("download.prompt_for_download", false);
options.AddUserProfilePreference("plugins.plugins_disabled", new []{"Chrome PDF Viewer"});

var service = ChromeDriverService.CreateDefaultService();
var driver = new ChromeDriver(service, options);
Florent B.
  • 41,537
  • 7
  • 86
  • 101