Auto download pdf files in Firefox
问题 I'm doing tests with Selenium and JUnit. I'm trying to export a report (pdf and xls). With Selenium, I click the download link, and do a verifcar to assert that the file is in the correct folder. I was able to test with the xls, but Firefox always asks what I want to do with the PDF. The configuration of Firefox, Selenium is this: String downloadPath = new File("src/test/resources/firefox_download").getAbsolutePath(); firefoxProfile.setPreference("browser.download.dir", downloadPath);