Verify a file download
Hard120 pts~45 min
- File download
- Browser preferences
- File system
Practice app · Document Vault
File upload and download, cookies, localStorage, sessionStorage and JavaScript execution.
Your starter code already declares TEST_URL — never hardcode a host.
Objective
Download the CSV report into a known folder and verify the file on disk, not just the UI message.
Your task
- 1Configure the browser download directory to a temporary folder (Chrome prefs download.default_directory, no prompt).
- 2Click #download-report and assert #download-status reads “Downloaded report.csv”.
- 3Poll until report.csv exists and no partial (.crdownload) file remains.
- 4Assert the first line is “id,document,owner,status,updated” and the file has 6 lines; delete it afterwards.
Acceptance criteria
- The downloaded file is checked on disk
- #download-status shows “Downloaded report.csv”
- At least 2 assertions pass
Selenium WebDriver 4 · Selenium · Files, windows & storage