邮递员-带有文件上传的POST请求 [英] Postman - POST request with file upload

查看:154
本文介绍了邮递员-带有文件上传的POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I正在测试事件流,其中步骤之一是上传文件,这是RAR文件。

I'm testing a flow of events which one of the steps is to upload a file, this is a RAR file. 

此步骤由POST请求完成,在正文中您可以添加字段并为其提供值,还可以选择文件字段,然后在右侧可以浏览并选择一个文件。

This step is made by POST request and in the body you can add fields and give them a value, also, you can choose a file field and on the right side you can browse and select a file.

仅在测试此步骤时,此步骤才能正常工作。但是,当您运行整个测试文件夹(带有所有测试请求)时,文件选择将被取消选择,测试将无法继续。

This step works properly when testing this step only. But, when you run the whole test folder(with all the test requests) then the file selection back to be unselected and the test can't continue. 

希望我的问题很清楚。
非常感谢。
阿米特。

Hope that my problem is clear. Thanks a lot. Amit.

推荐答案

如果您尝试通过收集运行器执行此操作,则不支持此功能。

If you’re trying to do this via the collection runner, this functionality isn’t supported.

这是Postman GitHub帐户上最近讨论的一个问题。

This is a issue being recently discussed on the Postman GitHub account.

https://github.com/postmanlabs/postman-app-support/issues/3137

可以实现此目的的一种方法是安装 Newman 并使用它在测试运行期间上传文件。

One of the ways that you can achieve this is by installing Newman and using this to upload the file during the test run.

这篇关于邮递员-带有文件上传的POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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