We need to check the file, but
we have some problems…
Has the file finished downloading?
What is the downloaded file called?
The file isn’t there… What happened?
How do we check it’s the right file?
Is the file from this test or the last test?
Looks like we didn’t keep
it simple after all stupid!
What we need to do
We need to make sure that we downloaded the
file or provided useful feedback if we couldn’t
We need to make sure that the file we
downloaded was the correct file
If it’s not in the DOM,
you’re doing it wrong!
Don’t click the download link with Selenium!
Use a library that is designed to download
remote files (Selenium isn’t)
Checking downloaded files
KISS (Keep It Simple Stupid), don’t try to write
complicated comparison logic!
Use the thing that everybody uses, a hash!
Save the files if the test fails! We are going to
want to look at them.