I developed a crawler with ruby watir-webdriver that downloads some files from a page. My problem is that when I click to download the second file, Chrome opens a bar in the
for new chrome (version 46 or newer) this options was changed now your hash must looks like this:
prefs = {
'profile' => {
'default_content_settings' => {'multiple-automatic-downloads' => 1}, #for chrome version olde ~42
'default_content_setting_values' => {'automatic_downloads' => 1}, #for chrome newer 46
}
}
browser = Watir::Browser.new :chrome, options: {prefs: prefs, args: ['--test-type', '--disable-infobars'}
As of Chrome 56.0.2924.87, February 17, 2017, the only preference you need to set (however you set them for your webdriver) is:
'profile.default_content_setting_values.automatic_downloads': 1
Giving an updated answer because most answers here use outdated preferences or show other preferences that are unnecessary.
This bug/enhancement has been raised in the chromedriver page at the below URL: http://code.google.com/p/chromedriver/issues/detail?id=130
Bug/Enhancement Status: Yet to be resolved.