Ok Im going to go back and retrace my steps
Is there anyway to change the preferences inside the Dictionary type at run time?
Iâm using Chrome 77 and I have the prefs Dictionary in my Desired Capabilities -> Web UI -> Chrome settings. The two properties I have in the dictionary are download.prompt_for_download = false and safebrowsing.enabled = true. Before adding these, Chrome would give me the keep/discard prompt immediately upon clicking the download button. After applying them, the file appears to begin downloading, however, when it gets to 100% it shows the keep/discard prompt instead of finishing.
Am I missing a property in my prefs dictionary?
My setup: Katalon 6.3.3, Windows 7, Chrome: 79.0.3945.130 (Official Build) (64-bit) (cohort: Stable)
I followed Brandonâs how-to (excellent work, thanks!) but I am not able to dismiss the âDownload multiple filesâ dialogâŚ
My Katalon settings:
Has anyone ever got this to work?
This is my diff result:
Thanks,
Dave
Funny you should ask, see my topic about this particular alert here:
tl;dr No, thereâs no way to handle this, outside of refreshing the page between downloads.
Hey Brandon,
Thanks for the feed-back
The idea of refresh works for me.
Not elegant but does the trick.
Cheers,
Dave
Hi Brandon,
Under âDictionary Property Builderâ
Can a GlobalVariable be used in the âdownload.default_directoryâ value?
Iâve tried a few variations but no luck so far.
For example I tried the following but it does not work:
download.default_directory= GlobalVariable.DownloadFolder
No, this would not work. The arguments given here are just read as Strings, so no method invocation would ever be triggered.
Thanks for the info Brandon.
Cheers,
Dave
@Brandon_Hein for Step 1, you can try also to simply navigate to chrome://prefs-internals (and refresh the page after the changes).
Should produce the same JSON results, already pretty printed. Save the page as txt or whatever you like and all good for diff-ing.
Wow, nice. This would definitely save a couple steps!
I will drop some links here so I can quickly find them later if needed:
List of Chrome driver specific capabilities:
And a comprehensive list of chrome switches (can be set through args
capability):
https://peter.sh/experiments/chromium-command-line-switches/
Do you have a link to list of prefs
arguments that can be set? I only found this link, but I donât think itâs the full list: https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/pref_names.cc?view=markup
This StackOverflow answer might have answered my question, although there are still some I cannot see in the list, like profile.default_content_settings.popups
or profile.content_settings.exceptions.automatic_downloads.*.setting
so Iâm still somewhat confused on having the entire list. And also, I wanted more information on preferences like the two I mentioned.
from the link i posted above:
prefs dictionary A dictionary with each entry consisting of the name of the preference and its value. These preferences are only applied to the user profile in use. See the âPreferencesâ file in Chromeâs user data directory for examples.
so I am able to find something like what you may need by navigating to chrome://prefs-internal:
those seems to match with what i can find in the /home/my_user_name/.config/google-chrome/Default/Preferences
file on linux (note that this file is huge)
not sure if it is exactly what you need but you can try
Appreciate your answer, but this isnât exactly what I was looking for. I wanted to see a list of all possible prefs
and their descriptions (i.e., what does enabling/disabling a specific preference do).
This gave me a nice laugh
This is a very old reply, but w/e, Iâll address it.
1.) Desired capabilities, especially Chrome capabilities, are in constant flux. Trying to maintain an exhaustive list of all capabilities, what they do, and how to set them would be a full time job.
2.) Rather than giving you a fish, weâre teaching you how to fish. This guide will assist you in finding ANY capability you may want to set, present or future.
I needed a machete to fight my way through the cobwebs
Here is the Firefox list â again, can be a little behind current release (I believe). all.js - mozsearch
More discussion (unsure if these are posted up-thread )
Hello,
I followed this strategy to try to disable the cache and for some reason itâs not working.
What I want is that when a new session of the browser opens, the cache is disabled. Manually itâs equivalent to opening the Devtools and checking the box âdisable cacheâ in the Network tab:
I did that manually, downloaded the preferences json file and verified this:
So I added that to my code:
Map prefs = [(âintl.accept_languagesâ) : GlobalVariable.locale,
âdownload.default_directoryâ: System.getProperty(âuser.homeâ) + File.separator + âDownloadsâ + File.separator,
âdownload.directory_upgradeâ: true,
âdownload.prompt_for_downloadâ: false,
âplugins.always_open_pdf_externallyâ: true,
âprofile.default_content_settings.popupsâ: 0,
âprofile.content_settings.exceptions.automatic_downloads.*.settingâ: 1,
**âdevtools.preferences.cacheDisabledâ: âtrueâ]**
Map <String, Map<String,String>> prefsFF = [(âprefsâ): prefs]
RunConfiguration.setWebDriverPreferencesProperty(âmoz:firefoxOptionsâ, prefsFF)
RunConfiguration.setWebDriverPreferencesProperty(âprefsâ, prefs)
And it doesnât work. When it opens, the cache is not disabled. I know itâs not disabled because weâre having a login problem that only happens if the cache isnât disabled (and the problem occurs when I run the automated tests even after this change) and also if I open the network tab, the box is not checked.
Any ideas?