Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download multiple files on Chrome with Capybara/Selenium?

I am using Capybara with Chrome and Selenium. When I attempt to click on a link that causes an automatic download, the file is downloaded correctly. If I try to do this again, Chrome shows the message: "This site is attempting to download multiple files. Do you want to allow this?"

enter image description here

I was looking for a flag that could be used to disable this message, but couldn't find anything. Is there any way I can get around this message and allow the multiple download without having to resort to a page refresh? (E.g. Is there any way I can click the Allow button programmatically?)

like image 266
Senseful Avatar asked Mar 21 '13 17:03

Senseful


People also ask

How do I download multiple files in Chrome?

In the Privacy and security section, select Content settings. In the Content settings screen, select Automatic downloads. You'll see one of two settings: If Do not allow any site to download multiple files automatically displays, select the toggle switch to enable the setting.

How do I download multiple files from a link?

As indicated, you can draw a rectangle around the links you want to select. This will highlight the links in yellow. From there you can either hit Enter to open the selected links in the same window, “Shift + Enter” to open in a new window, or “Alt + Enter” to download them.


1 Answers

Please see my work-around here:

https://code.google.com/p/chromedriver/issues/detail?id=130#c12

like image 58
St.Zelenin Avatar answered Sep 25 '22 12:09

St.Zelenin