Postman - POST request with file upload

久未见 提交于 2019-12-13 09:20:06

问题


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

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.


回答1:


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

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

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

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



来源:https://stackoverflow.com/questions/48295434/postman-post-request-with-file-upload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!