1

Selenium C# bindings have the ability to specify the chrome download location:

var options = new ChromeOptions().AddUserProfilePreference("download.default_directory", "D:\Downloads");

Does any appropriate realization exist for Edge & IE11?

TylerH
  • 20,799
  • 66
  • 75
  • 101

2 Answers2

0

IE does not use profiles.As such, there is no way to automatically download files to a specified location with Internet Explorer.

Pritam Maske
  • 2,670
  • 2
  • 22
  • 29
0

For Edge try the following for changing the default download location:

EdgeOptions options = new EdgeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("profile.default_content_settings.popups", 0);
prefs.put("download.default_directory",
System.getProperty("user.dir")+"\\downloads");
prefs.put("download.prompt_for_download", false);
Map<String, Object> edgeOptions = new HashMap<String, Object>();
edgeOptions.put("prefs", prefs);
edgeOptions.put("useAutomationExtension", false);
options.setCapability("ms:edgeChrominum", true);
options.setCapability("ms:edgeOptions", edgeOptions);
WebDriver driver = new EdgeDriver(options);
Kuruchy
  • 1,330
  • 1
  • 14
  • 26