Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prompt_for_download is still appearing after setting false in prefs

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',
            },

        },

    },
},
like image 529
user2388556 Avatar asked Mar 05 '15 02:03

user2388556


1 Answers

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:

  • Setting chromedriver preferences on protractor tests
like image 182
alecxe Avatar answered Nov 15 '22 01:11

alecxe