无法从显示文件下载提示停止量角器 [英] Can't stop Protractor from displaying file download prompt

查看:216
本文介绍了无法从显示文件下载提示停止量角器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我测试下载文件,但是当我触发下载,另存为...提示出现。
我看到了一个解决方案<一href=\"http://stackoverflow.com/questions/21935696/protractor-e2e-test-case-for-downloading-pdf-file\">SO问题似乎,但不为我工作。

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.

我的量角器配置文件看起来像这样(的CoffeeScript):

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

更多

chromeOptions。preF 的webdriver文档状态:

查看'preferences'文件为例子Chrome的用户数据目录。

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

我不能真正看到 default_directory 在我自己的铬preferences 的文件。

I can't actually see default_directory in my own Chrome preferences file.

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

系统


  • 量角器:版本1.5.0(pretty新)

  • 节点:0.10.28,0.11.8和0.11.14

  • 推荐答案

    提供对现有目录中的绝对路径 default_directory 的镀铬preference。

    Provide an absolute path to an existing directory in default_directory chrome preference.

    这篇关于无法从显示文件下载提示停止量角器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆