加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 无法停止量角器显示文件下载提示

发布时间:2020-12-17 17:24:47 所属栏目:安全 来源:网络整理
导读:问题 我正在测试下载文件,但是当我触发下载时,会出现“另存为…”提示. 我在SO question中看到了一个解决方案,但它似乎对我不起作用. 配置 我的量角器配置文件看起来像这样(coffeescript): exports.config = capabilities: browserName: "chrome" shardTest
问题

我正在测试下载文件,但是当我触发下载时,会出现“另存为…”提示.
我在SO question中看到了一个解决方案,但它似乎对我不起作用.

配置

我的量角器配置文件看起来像这样(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

更多

在chromeOptions.pref webdriver docs上声明:

See the ‘Preferences’ file in Chrome’s user data directory for examples.

我实际上无法在自己的Chrome偏好设置文件中看到default_directory.

"download": {
  "directory_upgrade": true,"prompt_for_download": false
},

系统

>量角器:1.5.0版(相当新)
>节点:0.10.28,0.11.8和0.11.14

解决方法

提供default_directory chrome首选项中现有目录的绝对路径.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读