I'm testing downloading a file, but when I trigger the download, the "Save as..." prompt appears. I saw a solution in this SO question but it doesn't seem to work for me.
My protractor config file looks like this (coffeescript):
exports.config =
capabilities:
browserName: "chrome"
shardTestFiles: true
maxInstances: 2
chromeOptions:
args: ['--no-sandbox', '--test-type=browser']
prefs:
download:
prompt_for_download: false
default_directory: '/'
default_content_settings:
popups: 0
On chromeOptions.pref
webdriver docs states:
See the 'Preferences' file in Chrome's user data directory for examples.
I can't actually see default_directory
in my own Chrome preferences file.
"download": {
"directory_upgrade": true,
"prompt_for_download": false
},
Provide an absolute path to an existing directory in default_directory
chrome preference.
For me, the Save As prompt was appearing when I mentioned a slash at last in the path for example: A:\Proj\Downloads\
& didn't see any prompt when mentioned without a slash at the end of the path i.e A:\Proj\Downloads
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With