Skip to main content

How to Download a File Without a Browser


In a previous tip we went through how to download files with Selenium by configuring the browser to download them locally and verifying their file size when done.

While the previous method works, it requires a custom configuration that is inconsistent from browser to browser.

Ultimately, we shouldn't care if a file was downloaded or not. Instead, we should care that a file can be downloaded, which we can do by using an HTTP client alongside Selenium in our test.