Postman - Running a request multiple times with different data sets (external data files)

Поділитися
Вставка
  • Опубліковано 15 жов 2024

КОМЕНТАРІ • 97

  • @vdespa
    @vdespa  4 роки тому +2

    👉 Want to learn more about Postman? Get my Postman complete course at a special price and help support this UA-cam channel.
    vdespa.com/courses/?q=UA-cam

  • @syedarmaghanhassan4652
    @syedarmaghanhassan4652 Рік тому +1

    Valentine makes cool videos and is a great teacher

    • @vdespa
      @vdespa  Рік тому

      You are welcome. Thank you for leaving a comment.

  • @paulofreitasview
    @paulofreitasview 3 роки тому

    Its possible to do this but without the runner?? like calling the external data by code or by javascript inside of pre-request script??

  • @cristhianlopez4456
    @cristhianlopez4456 2 роки тому

    @valentin Despa is possivel to run a collecion setting an env variable with any code(pm.set.enviorenment etc etc) and at the same time send values for others end points in the CSV? The end point that use the CSV file need the Env variables... Is that possivel?
    Greeting, all your videos are fantastics

    • @vdespa
      @vdespa  2 роки тому

      It is hard to answer this with the given information. Consider posting your question in the Postman community (community.postman.com/) and share what you have tried so far and where did you get stuck. Include screenshots and as many details as possible. Feel free to tag me with @vdespa. Thanks!

  • @Obaba-ey3gy
    @Obaba-ey3gy 5 років тому +2

    can you explain how to send the post request with multiple customer details including file via form-data from the postman?

  • @abhisheksvibe7523
    @abhisheksvibe7523 5 років тому +1

    Hi Valentin,
    This is a nice tutorial and thank you very much for that. But I have a question here if I want to run the Postman scripts in CICD pipeline then is there any way to use the external .json data file in scripts as in batch mode we are not able to select file from Postman collection. Any command is available to add that .json file with collection file so that every thing works fine in pipe line ?
    Appreciate your response on this.
    Thanks,
    Abhishek

    • @mylenna922
      @mylenna922 4 роки тому

      @Abhishek Guha I'm wondering the same thing, did you manage to complete this in your pipeline?

  • @hamedkhatami642
    @hamedkhatami642 3 роки тому +1

    very informative video, thank you, how can I export the Req. and Res. body of all iterations?

    • @vdespa
      @vdespa  3 роки тому +1

      Thanks. I will do a video on that soon. Stay tuned

  • @MatthewMcGuff
    @MatthewMcGuff 3 роки тому

    Was looking at the documentation and was wondering if it would be possible to name the iterations. I really like the idea of having an external file containing several different request body data sets but not having names for these makes this more painful to maintain. For example, say you are testing a POST route you could have named different request bodies based upon the case you are attempting to test. "All Fields Request Body", "Bad Data Request", "Null Check Request Body" etc. Will test this myself but wondering if anyone know what then happens when you hit send when you have defined you values from an external file. (I know this flow is intended for running test runner but would like to have the ability to perhaps select when request body I'm choosing to run when I hit send).
    Velentin, great video as always.

    • @vdespa
      @vdespa  3 роки тому

      Hi Matthew, I don't know a way to name the iteration itself. You can name the tests if you wish by inserting a variable in their name.

  • @FrankDoylezw
    @FrankDoylezw 4 роки тому +1

    @Valentin: thank you - these tutorials are great. Could you please explain how you handle your assertions in tests when using a data driven case like this? Your tests were failing due to the dynamic data you passed in - how do you similarly make your tests dynamic?
    Could you include the expected result in each array and then parameterise your tests too? In that way you are passing in not only the dynamic data for the request, but dynamic data for the test, too?

    • @vdespa
      @vdespa  4 роки тому +2

      Hi Frank, yes, you can get the data from the iteration in the test as well. Just use pm.iterationData.get("columnName"); I hope this helps.

    • @FrankDoylezw
      @FrankDoylezw 4 роки тому

      Thank you, Valentin. I also purchased your Udemy course and found your very helpful explanation regarding pm.iterationData there.

  • @harisaaron8358
    @harisaaron8358 11 місяців тому

    This is playing with the body , I need to change the param value how do I do ?

  • @shankarlingam4702
    @shankarlingam4702 2 роки тому

    Hi bro,
    Your the saviour for postman concepts and pls let us know how to automate soap service in postman

    • @vdespa
      @vdespa  2 роки тому +1

      Automating soap is not different from any other API. Check my latest tutorial.

    • @shankarlingam4702
      @shankarlingam4702 2 роки тому

      @@vdespa Thanks bro

  • @veenayadav6995
    @veenayadav6995 3 роки тому

    I want to run multiple external json files(100 request) in one go using newman. I searched about the same online, but of no use(I didn’t got any answer). So I hardcoded the same in newman. But some testscripts is running properly and rest of the testscript is giving error whereas when I ran each script on collection runner, it was running perfectly. Any guidance will be helpful to me. " 63⠄ JSONError in test-script"

    • @vdespa
      @vdespa  3 роки тому

      It is hard to know what the problem is in this case. Join the Facebook community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.

  • @dungvo150
    @dungvo150 3 роки тому +1

    Man, you just saved my day!

  • @meghagowda9077
    @meghagowda9077 4 роки тому

    Hi, i am storing my data in csv file.. I am able to read those data also..
    But, once aftr you execute and check the response body i can see the 2nd request has taken the first request value.
    Can you please help me out with this.
    Thanks in advance 😊

    • @vdespa
      @vdespa  4 роки тому

      It is hard to know what the problem is in this case. Join the Facebook community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.

  • @meghagowda9077
    @meghagowda9077 4 роки тому

    Hi valentine.
    Do we have option to write back the data from response to csv file..
    If so how is it possible.
    Can u share me the video related to that, which would help me in better understanding.
    Thanks in advance 😊

    • @vdespa
      @vdespa  4 роки тому

      Well, it really depends on the response. It is possible but you need to write some Node.js code to do that.

  • @simplearora1223
    @simplearora1223 3 роки тому

    How can i test one request with both positive and negative test scenarios.

  • @ntnvlgsvlgs7787
    @ntnvlgsvlgs7787 5 років тому +2

    Hey man, thanks for the video. How would turn the columns of a csv containing thousands of rows into the key value pairs of each object or iteration? Hope that makes sense.

    • @ntnvlgsvlgs7787
      @ntnvlgsvlgs7787 5 років тому +1

      @@vdespa each rows is like this, where each field is a key on the request customerid;country;url;segment

  • @ranadheerp5131
    @ranadheerp5131 Рік тому

    How to pass that parameter from url instead of body?

  • @goldgold4943
    @goldgold4943 2 роки тому

    Ur God of postman training for me

    • @vdespa
      @vdespa  2 роки тому

      You are welcome. Thank you for leaving a comment.

  • @hutchkishore
    @hutchkishore 3 роки тому

    Hello Valentin, Thanks for a nice video. Is it possible set the path of data file using code rather than selecting it manually everytime. Whenver I run a collection runner, I have to select the file manually even though there is no change in test data. Could you pls advise how to acheive this? Thanks

    • @vdespa
      @vdespa  3 роки тому

      You can edit the file and specify a path there. I would recommend using Newman for automation. It works great

    • @hutchkishore
      @hutchkishore 3 роки тому

      @@vdespa Sure Valentin. Will give it a try. Thanks a lot for your reply. Is it possible to specify the path in Postman instead of Newman as I am facing trouble setting up Newman.

  • @rudreshl5119
    @rudreshl5119 4 роки тому

    What to do for nested array here. Its not fetching values of variable instead it's showing the variable name itself (hope this is clear) please let me know if need more info

    • @vdespa
      @vdespa  4 роки тому

      I think I do need more details on this one. Join the Facebook community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.

  • @thavisalkirankumar9421
    @thavisalkirankumar9421 2 роки тому

    How to run the multiple requests for XML files by using the external files? I see the all videos only explain on json formats

    • @vdespa
      @vdespa  2 роки тому

      AFAIK, external XML files are not supported as data sets.

  • @chandrashekharchoudhari447
    @chandrashekharchoudhari447 4 роки тому

    Hi Valntine... good job... i want to ask about how to compare the two apis in postman?

    • @vdespa
      @vdespa  4 роки тому

      Do you mean how to compare two api responses?

  • @kavitamehta5133
    @kavitamehta5133 3 роки тому

    Hi Valentine.. Your video is very helpful.. Have one doubt.. How can we run multiple api's(all Get requests) under one collection with different data sets in one go using json file.. Is this possible to create a single json file with different data sets for each api under collection

    • @vdespa
      @vdespa  3 роки тому

      Have you looked into this? ua-cam.com/video/fr7UpFNQbLw/v-deo.html

    • @kavitamehta5133
      @kavitamehta5133 3 роки тому

      @@vdespa Thanks Valentine..I have checked this video..
      But my concern is how can we run multiple API's each having different variables under one collection in one go..
      Means column headings in CSV file will be different for each API request.Instead of uploading CSV file for each API request, is there any way by
      which i can run entire collection in one go by a click of button.

    • @vdespa
      @vdespa  3 роки тому

      @@kavitamehta5133 please ask this is the Facebook group. I need more details.

    • @veenayadav6995
      @veenayadav6995 3 роки тому

      @@kavitamehta5133 Hi Kavita, did u got any solution for the same issue. Even I am searching a lot regarding this issue, but all in vain. If u have any idea how to do it, pls do share me, it will be very helpful to me.

  • @merwinrodrigues3482
    @merwinrodrigues3482 5 років тому

    Hi Valentin, thanks for the video... How do i 1. fire multiple iterations of a single post request from a csv 2. collect the response in an array and then 3. fire multiple interations of a single Get request using the responses

    • @merwinrodrigues3482
      @merwinrodrigues3482 5 років тому

      @@vdespa ya sure...I have an api set that has a POST and a GET request. First i hit a post using data from a csv in the postman runner. It gives me a request id in the response, I have to use this request id in the GET request to retrieve the processed data. Processing normally takes between 8-10 seconds and I have 200 iterations. Keeping such a high delay makes the test run for a really long time i.e 10 secs * 200 iterations * 2requests.
      So what i want to do is fire the 200 Post requests and store the request ids and then fire 200 get requests after say 10 seconds

    • @merwinrodrigues3482
      @merwinrodrigues3482 5 років тому

      @@vdespa you understood it fine.So if i do a POST-GET, POST-GET with a delay of 10 secs im using 20 secs for one pair of iteration. Instead I can hit POST-POST-POST and then GET-GET-GET with a delay of maybe 500ms ...so by the time all the Posts are done the first request processing will be finished and my execution time will reduce considerably

  • @harishshet7268
    @harishshet7268 4 роки тому

    Hi , Thanks for the video , I have one doubt , assume I have 2 files inside the folder, and I wrote some test cases in .json file, both the files contains a post request and both are hitting to different end points, I want few test cases to get tested in first request, and other cases in second req file, how to distinguish between them, or we have only one request file in a directory? Thanks

    • @vdespa
      @vdespa  4 роки тому

      I am not sure what you mean by "2 files inside the folder". Are they data files with iterations?

    • @harishshet7268
      @harishshet7268 4 роки тому

      @@vdespa I have 2 requests inside the directory in postman, both are Post request, both request has different body, when I executed in runner I will be passing a testcase file i.e .json , I want that testcases gets executed only for a perticular request not for the both, how to o some thing like that, if it gets executed for both then definitely all test cases for the other request API gets failed

    • @vdespa
      @vdespa  4 роки тому

      @@harishshet7268 Have you considered using a single request and populating the body from the iteration data file?

  • @sobhankumara.v.1778
    @sobhankumara.v.1778 3 роки тому

    How to import json file to run for multiple requests in a workflow?

  • @rashmichauhan8675
    @rashmichauhan8675 3 місяці тому

    It’s awesome! Thanks for sharing

    • @vdespa
      @vdespa  3 місяці тому

      You are welcome. Thank you for leaving a comment.

  • @jassi7777777
    @jassi7777777 5 років тому

    @Valentin
    how can we use the same dataset.json file in postman monitors? is there any way using web view?

    • @jassi7777777
      @jassi7777777 5 років тому

      @@vdespa ok thanks. Also haven't found any solution to run a monitor with different dataset using env

  • @andrii5866
    @andrii5866 4 роки тому

    @Valentin Despa how i can do it with multiple form-data (uploading images for example ) ?

    • @vdespa
      @vdespa  4 роки тому

      I am not sure what you mean by that. Join the Facebook community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.

  • @abhishekdhaundiyal3664
    @abhishekdhaundiyal3664 2 роки тому

    hi, can you please give an example of how we can parametrize a nested json.

    • @vdespa
      @vdespa  2 роки тому

      Not sure what you mean. Can you share more details or an example?

  • @sathish.1998
    @sathish.1998 3 роки тому +1

    thanks. useful for me

    • @vdespa
      @vdespa  3 роки тому

      Glad to hear, thanks!

  • @johnabraham007
    @johnabraham007 4 роки тому

    @Valentin Despa
    i'm trying to run a web-service test Using CSV data files in the Postman Collection Runner . When i parameterize and give more than one value , for the 2nd iteration am getting the following error in the postman console
    Postman Collection Runner has two POST services and one PUT service , first service has email field and 2nd service has phone number .
    Service 1 :- POST
    service1/rs/register
    {
    "email": "{{email}}",
    "username": "testuser_{{$timestamp}}",
    "newPassword": "Online@1",
    "postalZip": "K2K3N5"
    }
    Service 2 :- POST
    service2/rs/profile/customer
    {
    "phone": {{phone}},
    "postalZip": "K2K3N5"
    }
    Service 3 :- PUT
    service3/rs/profile/link
    {
    "jobTitle":"Director",
    "title":"Ms"
    }
    for example my CSV file content is as below
    Email Phone
    test1@gamil.com 1234567890
    test2@gmail.com 1234567891
    for the 2nd iteration am getting the below error in the console for the Service 2 and service 3 is skipped.
    Error: read ECONNRESET Warning: This request did not get sent completely and might not have all the required system headers
    if i run this one by one i.e if the csv has only 1 value at a time then it works without any problem.
    What i have observed from console is that for the 2nd iteration for the 2nd run cookie is not taking correctly from the previous service.
    it was suppose to automatically take from the previous and exeucte , can you help me here @Valentin Despa ?

    • @vdespa
      @vdespa  4 роки тому

      I don't think the cookies will be automatically be passed from one iteration to the other. I am not familiar with your API, so I don't know exactly what is going on. The error "ECONNRESET" is too generic. You may need to look at the server error logs to understand what has happened.

    • @johnabraham007
      @johnabraham007 4 роки тому

      @@vdespa you have mentioned that cookie will not be passed from one iteration to another. Could you tell me how to clear cookie before each iteration ?

    • @vdespa
      @vdespa  4 роки тому

      @@johnabraham007 I am not sure what the current behavior is. Check the logs / header and see if this is the case, before trying to remove - it may not be needed. If you need to remove a cookie, check this: learning.postman.com/docs/postman/sending-api-requests/cookies/#delete-all-the-cookies . Make sure you check the callback function for errors.

  • @ranikale2277
    @ranikale2277 3 роки тому

    Is there any way to pass multiple file(formdata) in different iteration?

    • @vdespa
      @vdespa  3 роки тому

      It is hard to know what the problem is in this case. Join the Facebook community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.

  • @talkwithkapilmehtaandfamil5636
    @talkwithkapilmehtaandfamil5636 4 роки тому

    Hi!! I want hit a URL multiple times THROUGH postman. is it possible

    • @vdespa
      @vdespa  4 роки тому

      Yes, it is possible.

  • @mayconpires.oficial
    @mayconpires.oficial 5 років тому +1

    Thanks! Good Job!

  • @swatitomer5542
    @swatitomer5542 5 років тому

    Hi @Valentin can you explain how to post data with CSV file?

    • @swatitomer5542
      @swatitomer5542 5 років тому

      @@vdespa I tried to post using json and variable e.g. { "name" :{{name}},
      "marks":{{marks}}
      }
      And, I passed values of these variables in CSV file. But, on hitting send button it is showing 415 unsupported media

    • @swatitomer5542
      @swatitomer5542 5 років тому

      @@vdespa by putting variable between quotes showing 400 bad request.

  • @ankitshrivastava1772
    @ankitshrivastava1772 4 роки тому

    Hello Dear, in payload if we have to send some values in Array then how we can?

    • @vdespa
      @vdespa  4 роки тому

      How would the body look like? Do you use an external data file?

    • @ankitshrivastava1772
      @ankitshrivastava1772 4 роки тому

      @@vdespa yes i am using json in this case
      the payload is :
      "id" :"18035",
      "language" : ["Java","python"],
      "yearexp" : "3 year",
      "lastused" : "1 year",
      "st_id" : "163154"

    • @vdespa
      @vdespa  4 роки тому

      @@ankitshrivastava1772 So you want to get ["Java","python"] from an external file, right?

    • @ankitshrivastava1772
      @ankitshrivastava1772 4 роки тому

      @@vdespa Very thanks for helping me. Please Have a look on complete payload.
      {
      "id": 18036,
      "language": ["java","python"],

      "yearexp": "2",
      "lastused": "1 year",
      "st_id": "163154"
      }
      Note : I have created one json file in which I have 30 record with the same payload mention above. Now if I run the request all data is getting created for all 30 records but
      in "language" it is passing as null.
      so the story is when i only pass simple json key & value pair then it works fine and the issue is when we pass any key in an array.

    • @vdespa
      @vdespa  4 роки тому

      @@ankitshrivastava1772 How does your external file look like? Can you upload it somewhere so that I can look into it?

  • @bharathan1608
    @bharathan1608 4 роки тому +1

    really helpful.

    • @vdespa
      @vdespa  4 роки тому

      Glad to hear that!

  • @noorfathima-bv2cd
    @noorfathima-bv2cd Рік тому

    I want to give data from CSV file

  • @kvkulakarrni7257
    @kvkulakarrni7257 8 місяців тому

    how to add images

  • @taritray6336
    @taritray6336 4 роки тому

    Superb thanks

    • @vdespa
      @vdespa  4 роки тому +1

      Most welcome 😊

  • @latinbishop1722
    @latinbishop1722 Рік тому

    Did not work :-(. Get errors

  • @sajeerkunnoth6630
    @sajeerkunnoth6630 4 роки тому

    how to given json object in multiple iterations .
    {
    "date": "{{paymentEntryDate}}",
    "from": "",
    "name": "{{paymentPerson}}",
    "payments": [{
    "ApplyDate": "2020-01-28T13:10:00.282Z",
    "amount": "50",
    "paymentMode": "online",
    "comments": "test",
    "amountReceived": null
    }]
    }

    • @vdespa
      @vdespa  4 роки тому

      Do you need to replace an entire object?