Firefox not saving "Always download to ..." Option

Hello,
i’m running tests that start a download but when i run them in firefox (v 61.01) the download window pops open and asks whether to open or save the file. In the settings for firefox, i selected “Save files to …” with the location i want and it lists “save file” for the types of files i download under applications in firefox settings.
Nethertheless, whenever i start a testcase in firefox he always behaves as if the browser encounters the file type for the first time and asks where to save it.

I could be wrong but I believe the cache and settings are cleared when you start a new browser so it’s like a fresh instance of it. You will need to use some selenium with a custom function to do this automatically. I was able to do this on Chrome Browser. https://stackoverflow.com/questions/34515328/how-to-set-default-download-directory-in-selenium-chrome-capabilities

Can I do this by adding desired capabilities to Firefox in Project Settings/Execution/Default/WebUI/Firefox ? If yes, how do format it for firefox (the link only talks about chrome).

The Doc mentions this specific Problem ( https://docs.katalon.com/pages/viewpage.action?pageId=13700172 ) as an example for custom capabilities in Firefox and i have added the settings from the example with the correct mime type for the two file types that are being downloaded.
But when i execute it, the window still pops up.
Here are my current settings:

FirefoxSettings.png

I’ve never gone about it the way you are in the project settings. I ran into a similar issue though when I was setting the custom download path. Despite having changed it I still got the popup too. I had forgotten to take into account the way Windows parsed file paths.

The file path I was trying to use was using the File Separator (which is \ ) instead of /. For example the custom path I was trying to setup in the settings was the string “C:\Folder\CustomDownloads”. The format it was looking for was “C:/Folder/CustomDownloads”.

I had to set up a custom method to parse out the File.separator and replace it with with the / character. Took some work but it does work now. It just didn’t like the File.separator

The format it was looking for was “C:/Folder/CustomDownloads”.

I tried your proposal, unfortunatly it doesn’t seem to have any effect. When i launch a test case in firefox, he lists all the custom capabilites like this:
[INFO] - User set preference: [‘browser.helperApps.neverAsk.saveToDisk’, ‘application/vnd.ms-excel, text/csv’]
But the popup still shows up and asks if the file should be opened or downloaded.

I have found part of the error, the settings must be in a dictionary property builder for firefox_profile. The mime type also had to be adjusted.

Marco Raphael said:

I have found part of the error, the settings must be in a dictionary property builder for firefox_profile. The mime type also had to be adjusted.

Marco,
Is it working for you now. Am having the same exact issue with FF. Please share your exact firefox_profile. I have mine on the dictionary property but still not working.

image.png

Here are my entries in the firefox_profile dictionary:
browser.helperApps.neverAsk.saveToDisk - String - application/vnd.ms-excel, application/csv
browser.helperApps.alwaysAsk.force - Boolean - false
browser.download.folderList - String - 2
browser.download.dir - String - c:/example
browser.download.downloadDir - String - c:/example
browser.download.defaultFolder - String - c:/example
browser.download.forbid_open_with - Boolean - true

Thanks Marco. I have the same exact entries on my profile however I never go past the Firefox “file save dialog” which means the excel file never get’s downloaded locally.
Any more ideas? Am using Katalon 5.6 and Firefox 52.
Thanks

Capture.JPG

james nganga said:

Thanks Marco. I have the same exact entries on my profile however I never go past the Firefox “file save dialog” which means the excel file never get’s downloaded locally.
Any more ideas? Am using Katalon 5.6 and Firefox 52.
Thanks

I use Firefox 61, that could be the reason. Another thing you could try is changing the entries application/vnd.ms-excel to something else depending on which file you try to download. I had to change this too - look for a list of mime types.

Hi every,

I have been working with katalon.

And on this way it works for me:

Can you expand the Name column? I can’t see all of the text, therefore I do not know what the name is supposed to be.

hi,

check these pages
http://kb.mozillazine.org/About:config_entries
http://kb.mozillazine.org/Category:Preferences

1 Like

Yes, here is the screenshot showing the names:

Anyway I can resolve the following popup?
image

These are my current settings: (Apologies, noticed a mistake in my settings. Below are my updated settings).

Another edit: Below are the settings for what I want excluded:

Ok, I have solved it I believe. Since my file was of format “.xlsx”, I had to add application/vnd.openxmlformats-officedocument.spreadsheetml.sheet to prevent the pop-up from asking what to do with this file type.

If anyone else is having problems with the MIME types (the file types you place within those settings), use this link: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types

Hi everyone,
I tried every combination possible from this thread and even from this video Katalon Studio | 10 | How to download a file and verify the downloaded file | Tamil - YouTube but I can’t solve the problem!

I’m trying to not open the popup download that asks whether to open or save the file popup from a PDF file.
After attempting using your solution I tried different variation of this settings vecchio
because i thought that if i used the default folder (setting 1 instead of 2 in browser.download.folderList ) maybe it can work…but it doesn’t.
I even tried comparing my browser about:config with the one from katalon browser but the only difference is that browser.download.panel.shown is always true in katalon even if i set it false and browser.download.manager.showWhenStarting
doesn’t even exist…

(on the left katalon about:config and on the right my browser that doesn’t do the popup about:config)

The last settings I tried just from the knowledge of about:config is this one:

I always used the MIME type for the pdf file.
Firefox is ver 71.0 and katalon is 7.2.1.

Please help me, I really don’t know what to do to solve the problem!

I’m having the same issue. I have no clue why the DesiredCapabilities set in Project Settings do not work with Firefox.

If you’re willing to try a solution other than the Project Settings, see this post: How to setup Firefox to download files without prompt during Katalon test execution?