简体   繁体   English

如何使用量角器通过脚本处理windows文件上传和下载?

[英]How to handle windows file upload and download through script using protractor?

How to handle windows file upload and download through script using protractor?如何使用量角器通过脚本处理windows文件上传和下载? Windows file Upload Image Windows 文件上传图片

<input name="upload" type="file">

Upload Solution:上传解决方案:

var absolutePath = path.join(__dirname,'..\\..\\dash-e2e-tests\\resources\\files-cabin\\test-files\\image.png);

element(by.xpath("xpath")).sendKeys(absolutePath);

Download Solution:下载解决方案:

capabilities: {
    browserName: 'chrome',
    'chromeOptions': {
        prefs: {
            download: {
                'prompt_for_download': false,
                'directory_upgrade': true,
                'default_directory': downloadfile
            }
        }
    }

},

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM