postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.84k stars 839 forks source link

CSV values aren't running in Collections #2641

Closed proverbguy closed 7 years ago

proverbguy commented 7 years ago
  1. Postman Version:4.9.2 win / x86-32

  2. App (Chrome app or Mac app):Chrome 55.0.2883.87

  3. OS details:

  4. Is the Interceptor on and enabled in the app: no

  5. Did you encounter this recently, or has this bug always been there: not a bug -- probably operator error

  6. Expected behaviour: trying to use a csv file to run a collection of upc codes -- csv, and upc codes, seem to preview correctly (see screenshot) but when i start a test in the collection runner the results are 0 passed 0 failed. I'm not at all a programmer so i'm stumbling through this. just trying to find a quicker way of accomplishing a very mundane task. screenshot 2017-01-17 12 10 25 screenshot 2017-01-17 12 09 12 screenshot 2017-01-17 12 09 45 screenshot 2017-01-17 12 09 24

  7. Console logs (http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/ for the Chrome App, View->Toggle Dev Tools for the Mac app):

  8. Screenshots (if applicable) see attached

sdnts commented 7 years ago

Hey @proverbguy, the counts in the Runner window are actually the number of tests passed / failed. Since I see you do not have any tests written, these counts aren't updated. You write tests to verify if the response received from your server is as you expected. You can test stuff like the presence of a value in the response body, the response status code, etc.

Here are docs to help you get started with Postman tests. There are also some examples here

In your case, what is happening is, the requests are being sent correctly, with the variable vUPCCode substituted correctly, but the lack of tests elicits the 0 passed / 0 failed state.

proverbguy commented 7 years ago

Thanks @madebysid. I'm not meaning to test for anything. I'm trying to use an api get request and UPC code to capture product data. Is there a way to run a csv containing upc codes with individual get requests and then, export the result?

sdnts commented 7 years ago

Ah, so you just want the request & responses, while reading variables from a file? In that case, the Postman App wouldn't be the correct tool to use. You should look into Newman. Newman is a command line collection runner. Newman's reporters should be helpful. Since Newman does not log out any responses, what you can do is keep logging out the responses from your requests, and pipe Newman's output to a file.