8. 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?
9. Looks like we didn’t keep
it simple after all stupid!
10. 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
11. If it’s not in the DOM,
you’re doing it wrong!
Collin’s Law
12. Downloading Files
•
Don’t click the download link with Selenium!
•
Use a library that is designed to download
remote files (Selenium isn’t)
13. 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.