When I ask people if they really need to download the file, they normally say, "Yes, I do! I need to make sure that the download functionality works, and continues to work after a code change."
That sounds pretty reasonable so far. I then pose the following questions:
- How many files are you planning to download?
- How big are these files?
- Do you have enough disk space to hold all of these files?
- Do you have network capacity to continually download these files?
- What are you planning to do with the file(s) once you have downloaded them?
The answer to the last question is the most interesting one. People I talk to usually say something along the lines of this: "Well, I don't know. Delete it? I just need to know that it downloads; I'm not actually planning to do anything with it."
So the real question is: Do you really need to download a file to perform this test? What you are really saying is that, when you click on the PDF download link, you want to be sure that you are getting a valid response from the server.
You are not really checking that you can download the file, you are checking for broken links.
This is a worthwhile test, but it doesn't actually require you to download anything. So let's forget about trying to interact with that OS-level dialog box for now and see how we can check to see if the link is valid.