0

I want to download files automatically to particular folder using Firefox(54.0.1 (32-bit)) and Selenium. Now I'm getting the download window each time, when I want to download a file(.pdf) and the path is always default(I want to customise it). What I have tried (serenity.properties):

browser.download.lastDir = C:\\Path\\To\\The\\File\\
browser.download.folderList = 2
browser.download.dir = C:\\Path\\To\\The\\File\\
download.prompt_for_download = false
browser.download.manager.showWhenStarting = false
browser.download.manager.addToRecentDocs = true
browser.download.manager.useWindow = false
browser.download.useDownloadDir = true
browser.download.show_plugins_in_list = true
browser.download.animateNotifications = false
browser.helperApps.neverAsk.saveToDisk = text/plain,application/octet-stream,application/pdf
browser.helperApps.neverAsk.openFile = text/plain,application/octet-stream,application/pdf
browser.helperApps.alwaysAsk.force = false
pdfjs.disabled = true
plugin.scan.Acrobat = 99.0
plugin.scan.plid.all = false
plugin.disable_full_page_plugin_for_types = application/pdf
pdfjs.enabledCache.state = false

For example in chrome it works for me with this settings(serenity.properties)

chrome_preferences.safebrowsing.enabled = true
chrome_preferences.download.default_directory = C:\\Path\\To\\The\\File\\
chrome_preferences.profile_default_content_settings.popups = 0

PS I have tried already many suggestions from the Internet inclusive this site, but still no luck. Any suggestions?

Andrei Suvorkov
  • 5,559
  • 5
  • 22
  • 48
  • Possible duplicate of [Auto-download in firefox browser with java-selenium not working](https://stackoverflow.com/questions/45589571/auto-download-in-firefox-browser-with-java-selenium-not-working) – undetected Selenium Mar 12 '18 at 08:15
  • @DebanjanB [Auto-download in firefox browser with java-selenium not working](https://stackoverflow.com/questions/45589571/auto-download-in-firefox-browser-with-java-selenium-not-working) didn't solve my problem – Andrei Suvorkov Mar 12 '18 at 08:30
  • Check this QA - https://stackoverflow.com/questions/44074656/after-setting-firefox-profile-firefox-keeps-asking-download-location-when-downl/44084814#44084814 – undetected Selenium Mar 12 '18 at 08:32
  • @DebanjanB [also no luck](https://stackoverflow.com/questions/44074656/how-to-download-csv-file-through-firefox-profile-in-java/44084814#44084814) . I have tried to download from another website something, to make sure that it doesn't depends on website I'm using. Download window appears and download path is by default. – Andrei Suvorkov Mar 12 '18 at 08:52

0 Answers0