from pathlib import Path# Send absolute path to <input type='file'>:
file_path = Path("test_data/invoice.pdf").resolve()
driver.find_element(By.CSS_SELECTOR, "input[type='file']").send_keys(str(file_path))
# Verifying downloaded file exists:
download_file = Path.home() / "Downloads" / "report.csv"
assert download_file.exists(), f"Downloaded file {download_file} not found!"