Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 420
Alexandre Videschi Avatar asked Jun 22 '17 18:06

Alexandre Videschi


1 Answers

I found the solution. Just add a preference:

var options = new ChromeOptions();
options.AddUserProfilePreference("profile.default_content_setting_values.automatic_downloads", 1);
like image 114
Alexandre Videschi Avatar answered Oct 09 '22 23:10

Alexandre Videschi