Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

What did you just download?


Published on

Presentation about file download tests with Selenium.
Presented at the London Selenium Meetup on 26 Feb 2014

Published in: Technology
  • Be the first to comment

What did you just download?

  1. 1. Mark Collin @Ardesco
  2. 2. Downloading files, easy right?
  3. 3. Auto It • Different script for each browser • Script may break with browser upgrade • Windows only • Not KISS (Keep It Simple Stupid)
  4. 4. Browser set to automatically download files • It’s KISS • Cross Platform
  5. 5. Let’s look a bit harder…
  6. 6. 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?
  7. 7. Looks like we didn’t keep it simple after all stupid!
  8. 8. 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
  9. 9. If it’s not in the DOM, you’re doing it wrong! Collin’s Law
  10. 10. Downloading Files • Don’t click the download link with Selenium! • Use a library that is designed to download remote files (Selenium isn’t)
  11. 11. 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.
  12. 12. You don’t have to use Java!
  13. 13. Questions?
  14. 14. Mark Collin @Ardesco