Alexandre Videschi
Alexandre Videschi

Reputation: 371

Allow Multiple Downloads in ChromeDriver

I need to download multiple files in Chrome using ChromeDriver ( C# ), first file is downloaded successfully, but the anothers not download, appeared a window asking "Download Multiple Files - Allow | Block "

I need to configure to download automatic. In Preferences of Chrome have this options "Settings -> Content Settings -> Automatic Downloads -> Allow all sites do download multiple files automatically"

I need to configure in "ChromeOptions" like in example

var options = new ChromeOptions();
options.AddUserProfilePreference("...", true);

Below is the image with Chrome message

Window of Chrome message

Upvotes: 12

Views: 9603

Answers (1)

Alexandre Videschi
Alexandre Videschi

Reputation: 371

I found the solution. Just add a preference:

var options = new ChromeOptions();
options.AddUserProfilePreference("profile.default_content_setting_values.automatic_downloads", 1);

Upvotes: 23

Related Questions