在prefs中设置为false后,Prompt_for_download仍然出现 [英] Prompt_for_download is still appearing after setting false in prefs
本文介绍了在prefs中设置为false后,Prompt_for_download仍然出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有下面这个配置,并已将prompt_for_download设置为false,但由于某种原因,当我运行测试时,提示下载对话框不断出现。难道我做错了什么?
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?
对于下载代码,我从此处和
ChromeDriver 2.14。
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',
},
},
},
},
推荐答案
我想你也需要添加 directory_upgrade
:
I think you also need to add directory_upgrade
:
prefs: {
download: {
prompt_for_download: false,
directory_upgrade: true,
default_directory: '/tmp/downloads'
},
},
除此之外,请确保 / 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
这篇关于在prefs中设置为false后,Prompt_for_download仍然出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文