2

I have a REST API call, which will take Multipart Data as Content-Type with a file(zip,rar,etc) and JSON Object as parameters shown below

The Request Structure in Postman

Now i wanted to write an automated test script for this API to run on Postman, but facing a problem in uploading a file during the Execution of the Collections.

Kindly share any views on how to upload a file during the Test execution.

2
  • Hi @Ramavi if any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. Commented May 13, 2017 at 2:29
  • Hi @Ray, i'm trying out this, but my newman test run is failing, so trying to fix that. Commented May 13, 2017 at 5:43

1 Answer 1

1

It has to be done with Newman. The Postman docs and blog explain how:

  1. https://www.getpostman.com/docs/run_file_post_requests
  2. http://blog.getpostman.com/2014/11/15/using-newman-to-run-collections-with-file-post-requests/
Sign up to request clarification or add additional context in comments.

1 Comment

Its working now, in newman i have used -k option as well to run my collection.json and outcome was success.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.