File Downloads - Instructions
This page implements multiple ways initiating a file download.
Download Files
File Downloads are relatively easy to test.
- Click Download
- Check Results
They are sometimes a little harder to automate.
Automating Download Files
One approach to automating Downloads is to use an HTTP library and directly pull down the file.
The other is to use the default functionality in your chosen Browser Automating Tool and trap the file download.
Page Functionality
The page has multiple approaches to generating the file.
JavaScript is not always used so some links and button has a reference to the file URL. Some of these connect directly to a file on the server, some make a server call which generates and returns the file.
The common theme with the JavaScript implemented download buttons is that none of the buttons or links connects to the file directly. They have to be clicked, then the file download is initiated.
Any Automated Execution has to trap or handle the background file download.
Automating
Try and trigger each download mechanism using both direct and browser based automating.
Make sure to compare the results of the download to what you expected.