I have this below config and already set prompt_for_download to false but for some reason, when I run the test, prompt for download dialogue is keep appearing. Am I doing something wrong?
For download code, I'm following solution from here and ChromeDriver 2.14.
Thanks.
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
args: ['--lang=en', '--start-maximized'],
prefs: {
'download': {
'prompt_for_download': false,
'default_directory': '/tmp/downloads',
},
},
},
},
I think you also need to add directory_upgrade
:
prefs: {
download: {
prompt_for_download: false,
directory_upgrade: true,
default_directory: '/tmp/downloads'
},
},
Aside from that, make sure /tmp/downloads
directory exists and there are permissions to write into it. Also see a similar issue:
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