This article is one of the “Web Test Automation Workbook” series, a set of bite-sized exercises (typically 15–20 mins). A practical and satisfying way to learn web test automation with Selenium WebDriver.
Learning Objectives
Design reliable automated tests that are user aware.
Customize the Chrome browser to save downloaded files into a specified folder
Verify a File Exists
Awareness of execution side effects: the file already exists
Click the “Print” link, wait up to 5 seconds, and then check the PDF file is generated.
Obviously, the focus of this exercise is to check the downloaded file. It appears very simple during manual testing. However, in test automation, we need to consider the following:
How to verify a file exists? This is easy: use code.