Postman - Running a request multiple times with different data sets (API testing)

  Рет қаралды 195,078

Valentin Despa

Valentin Despa

Күн бұрын

Пікірлер: 180
@narekumar3840
@narekumar3840 2 жыл бұрын
More Useful and thanks for covering the scenario which I am looking for, Much Appreciated
@vdespa
@vdespa 2 жыл бұрын
Glad it was helpful! You are welcome.
@apekshapatel8855
@apekshapatel8855 2 жыл бұрын
Thank you very much!! this is exactly I am looking....getting after a lot of searches.
@vdespa
@vdespa 2 жыл бұрын
Glad I could help! You are welcome. Thank you for leaving a comment.
@AlessiaCaraFans
@AlessiaCaraFans Жыл бұрын
is it possible to do the same without collection runnet , just scripts in postman ? to save multiple datasets from csv file?
@sowmyakalvagadda6711
@sowmyakalvagadda6711 5 жыл бұрын
I am using the same code to insert [ "7666","3333","6667"] values and running through collection runner but I see only one request being called and the other are not even shown. Please help me
@sowmyakalvagadda6711
@sowmyakalvagadda6711 5 жыл бұрын
I changed the iteration number to multiple times in collection runner and it's accepting multiple values in arrray. Does this make sense?
@Danish-797
@Danish-797 4 жыл бұрын
@@sowmyakalvagadda6711 : this wont help, your solution to set the iteration doesn't solve the purpose.
@jigneshpatel147
@jigneshpatel147 4 жыл бұрын
yes same-thing for me. it's run only once
@wanderincanada333
@wanderincanada333 2 жыл бұрын
Changing iteration number helped me
@matthewmurnaghan4473
@matthewmurnaghan4473 Ай бұрын
I tweaked the script for my own use case and it worked for me, some slight caveats though: 1. I used the new syntax pm.execution.setNextRequest("Name of your request in collection here"). If the url is dynamically constructed, it is better to use the name of the request. 2. If you add pm.execution.setNextRequest(null) it kills your run, so just leave this blank and the collection runner will naturally continue to the next request or exit if there are none left.
@vdespa
@vdespa Ай бұрын
@@matthewmurnaghan4473 Great 👍 thanks for sharing.
@simplearora1223
@simplearora1223 3 жыл бұрын
Hello Valentine, I tried almost the same thing i.e passing an array of values to an api and when i executed the same API i got a message "There are no test for this request". Why am i getting this message?
@vdespa
@vdespa 3 жыл бұрын
As the error says, you probably did not write any tests for the request.
@simplearora1223
@simplearora1223 3 жыл бұрын
@@vdespa I have written the same code as that of yours.I was passing a wrong variable name and hence was getting this message. Strange though.It works now. Thanks for your response.
@pearlking
@pearlking 3 жыл бұрын
@@vdespa For me also it showed the same message but the multiple post operation also worked as expected.
@zom786
@zom786 Жыл бұрын
Thanks for the guide. I followed it from the start to finish, however when I try to run the collection, my request is executed only once and I see the "No tests found" message. Any ideas what is wrong?
@vdespa
@vdespa Жыл бұрын
"No tests found" appears when there are no tests.
@yogitzz.kulawade253
@yogitzz.kulawade253 10 ай бұрын
I also faced the same issue: it shows no tests
@sibanidevi930
@sibanidevi930 6 ай бұрын
I am unable to pass multiple values using the approach mentioned in the video ,its only executing first value provided once only
@meandherforeternity
@meandherforeternity Жыл бұрын
What should i do when i have multiple variables to be changed. Example company name and address
@rallysahil
@rallysahil 6 ай бұрын
HOw can I execute same api with diiferent files in a folder. Each file is selected in the upload field as binary data ?
@ankurvishwakarma7776
@ankurvishwakarma7776 3 жыл бұрын
Hey, it is not working for multiple iterations if there is only single request in the collection
@theraahi_in
@theraahi_in 3 жыл бұрын
Short and crisp. Thank you! :)
@vdespa
@vdespa 3 жыл бұрын
I am glad it matched your expectations. Thanks
@VictorDabela
@VictorDabela 5 жыл бұрын
Great video! It helped me a lot to solve some massive integration problem with multiple customers. Thanks!
@harishkce1989
@harishkce1989 Жыл бұрын
Hello VAlentin - so this example is basically 1 iteration is set on the collection runner - but internaly the request itself loops to 3 times based on the array length ?? correct me if i understood wrong
@jackofalltrademasterofsome
@jackofalltrademasterofsome 5 жыл бұрын
Excellent one. Helped me in a very tight situation. Thanks.
@vdespa
@vdespa 5 жыл бұрын
Glad to hear that! Thank you for your comment.
@OliverUnderTheMoon
@OliverUnderTheMoon 6 жыл бұрын
Thank you for this helpful video. I chose to use: if (companies instanceof Array && companies.length > 0) { and: if (!(companies instanceof Array)) { instead of truthy evaluation because maybe some non-array value could evaluate to true.
@stars-and-clouds
@stars-and-clouds 3 жыл бұрын
I need to paginate to get all the data from an API, for example: 500 names per page and start from 501 next request until we reach 170K, so 340 requests. How do I increase the offset parameter by 500 each time?
@vdespa
@vdespa 3 жыл бұрын
Have you tried using a variable to store the last entry number?
@gattupalli690
@gattupalli690 4 жыл бұрын
Thanks so much. This was such a respite for me where I had to run the APIs for 100 property ids. I could do it
@vdespa
@vdespa 4 жыл бұрын
Glad it helped.
@dimakatsomashao3483
@dimakatsomashao3483 4 жыл бұрын
Please help i want to chieve the same thing
@harshshukla569
@harshshukla569 2 жыл бұрын
Great Tutorial, this was super helpful!
@vdespa
@vdespa 2 жыл бұрын
Glad it was helpful!
@patriciapaez3233
@patriciapaez3233 Жыл бұрын
Thank you very much. Do you have some material for learning how to make concurrent multiple requests? Thanks in advance.
@1902garimatiwari
@1902garimatiwari 2 жыл бұрын
Hi, Can you suggest a solution for the below requirement I need to form the request body from the json files present on a certain path, each json file is a separate request body. And also the number and names of files may vary.
@varalikaagarwal4477
@varalikaagarwal4477 3 жыл бұрын
Hey , I need to convert the string which I am passing in base 64 ,so how can i send multiple data with base 64.
@vdespa
@vdespa 3 жыл бұрын
Base64 is just the encoding. The principle stays the same. You may also want to look into creating a CSV or JSON file with the iteration data.
@LaTernurin
@LaTernurin 4 жыл бұрын
Michas gracias, me ayudo mucho con este ejemplo para aplicarlo. Excelente tutorial
@vdespa
@vdespa 4 жыл бұрын
¡Gracias por tu comentario! Me alegro de que el tutorial haya sido útil.
@poojanimodiya7998
@poojanimodiya7998 4 жыл бұрын
I have tried using this approach but did not work for me as expected. While running through collection runner, request runs only once and to run with next set of data i need to run collection again. Is it something i am missing that you could help? 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.
@nghiavoai7993
@nghiavoai7993 4 жыл бұрын
Thank you very much, this is the exactly what tip I need right now!
@vdespa
@vdespa 4 жыл бұрын
Great to hear!
@RoryGaddin
@RoryGaddin 4 жыл бұрын
Thanks Valentin, I found this tutorial very useful. Well explained and easy to follow.
@vdespa
@vdespa 4 жыл бұрын
I am glad it was helpful, Rory! Thanks for your comment.
@ChandraSekhar0085
@ChandraSekhar0085 4 жыл бұрын
Thanks Valentin. Very useful one
@vdespa
@vdespa 4 жыл бұрын
Thanks
@jpeca13
@jpeca13 5 жыл бұрын
Your Postman related tutorials are great. Related to this one I do not understand the advantage of the pre-request script instead of using data file when running a collection. Seems easier for me to create a csv/json file and select it in Collection Runer.
@vdespa
@vdespa 5 жыл бұрын
Thank you for your comment. Regarding you remark, you are right. What I am showing is relevant when the iteration data comes from a previous request. The pre-request script was just a way to store it.
@vdespa
@vdespa 4 жыл бұрын
Download the FREE Postman Quick Reference Guide 👉 www.subscribepage.com/postman
@Red999u
@Red999u 3 жыл бұрын
I've recently started using Insomnia Core rather than Postman but it's missing some key features. Is there a feature similar to the Postman Collection runner feature i can set up in Insomnia?
@vdespa
@vdespa 3 жыл бұрын
Sorry, I don't use Insomnia.
@MsTwte
@MsTwte 4 жыл бұрын
@ Valentin Despa inside the if statement in the "pre-request script" you're redeclaring the variable companies. this cause alot of issue for me but it's solved by simply removing the "var" keyword inside the if statement
@vdespa
@vdespa 4 жыл бұрын
Glad you have found a solution. Thanks for letting me know.
@sukanyashide9188
@sukanyashide9188 3 жыл бұрын
#need help Instead of uploading files during Run, can we provide a URL so every time I don't need to upload files?
@vdespa
@vdespa 3 жыл бұрын
If you are testing a file upload, you need to actually upload a file otherwise your test is useless.
@amitmokashi2388
@amitmokashi2388 4 жыл бұрын
Do you know, if we can pass elements from excel file & verify against another excel file?
@vdespa
@vdespa 4 жыл бұрын
I don' thinks would be possible.
@srikanthkorada508
@srikanthkorada508 2 жыл бұрын
@valetin Despa, I have to set the response data values for different requests in same environment variable. Is it possible? (Ex environment variable: values : 1,2,3,4). Do we have any method instead of pm.environment.set(). Set method is updating with new value. I need to add multiple values to same variable.
@vdespa
@vdespa 2 жыл бұрын
If you need to add multiple values to same variable, you may want to use an array to store this.
@lucaspiresnabais877
@lucaspiresnabais877 4 жыл бұрын
Is there a way to do this exact same but using the console runner newman?
@vdespa
@vdespa 4 жыл бұрын
Yes, you can also use newman for this.
@christopherhoup3531
@christopherhoup3531 2 жыл бұрын
I have followed your example exactly as you've coded, but my post only runs once and stops after Google.
@vdespa
@vdespa 2 жыл бұрын
Use console.log to debug your script.
@1241GIBEK
@1241GIBEK 3 жыл бұрын
I got error ' the request does not have any test '
@hairdryerjukebox
@hairdryerjukebox Жыл бұрын
Would you recommend this technique when testing for different result codes? E.g. Checking 200, 401, 404 based on parameter values.
@ankajgoyal8197
@ankajgoyal8197 5 жыл бұрын
How can i achieve this if i am having multi-form data instead of raw json and file needs to be selected from the file directory. Thanks
@zeenatahmed598
@zeenatahmed598 4 жыл бұрын
I am new to Postman and running into a recurrent issue that I can’t figure out. I am trying to run the same request multiple times using an array of data established on the Pre-request script, however, when I go to the runner the request is only running once, rather than 3 times. Can somebody help
@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.
@meandherforeternity
@meandherforeternity 2 жыл бұрын
Awesome. You saved my day, liked and subscribed your channel :)
@vdespa
@vdespa 2 жыл бұрын
Glad I could help! You are welcome. Thank you for leaving a comment.
@merajulhaque9107
@merajulhaque9107 4 жыл бұрын
postman.setNextRequest("xyz") throwing BAD Request 400, please suggest
@sumitpatra2418
@sumitpatra2418 3 жыл бұрын
How do I login to a page with different usernames and passwords
@vdespa
@vdespa 3 жыл бұрын
Maybe Postman is not the best tool for the job.
@sumitpatra2418
@sumitpatra2418 3 жыл бұрын
@@vdespa If I am to try the above on Postman, is there a way ?
@victorregoz
@victorregoz 5 жыл бұрын
does this works in the monitor (sandbox)? I need to set up a loop just like this in a monitor, I read that postman.* operations do not work on the sandbox.
@victorregoz
@victorregoz 5 жыл бұрын
@@vdespa Hi, I asked directly to the forum and I misunderstood something, what is not available in the sandbox are some dynamic variables apparently but postman should work. Thanks for your concern!
@chauhanvipul2009
@chauhanvipul2009 3 жыл бұрын
Excellent Brother.
@vdespa
@vdespa 2 жыл бұрын
Thank you. I really appreciate it.
@pandemonium8276
@pandemonium8276 4 жыл бұрын
Hello Valentin, how are you? I was trying to do this in one of my tests but it doesn't work. Did something change and it's not possible to do it anymore? THanks
@vdespa
@vdespa 4 жыл бұрын
Please check again your code. This should still work.
@manikandanp2409
@manikandanp2409 4 жыл бұрын
@@vdespa Yes, i just verified and working.
@manikandanp2409
@manikandanp2409 4 жыл бұрын
I did a mistake too. That was postman.sendNextRequest("reqName") instead of postman.setNextRequest("reqName");
@subashskj83
@subashskj83 4 жыл бұрын
in the Data Set Result, why the PASSED and FAILED is ZERO??
@vdespa
@vdespa 4 жыл бұрын
Good question. This is because I haven't written any tests.
@hanumansays3725
@hanumansays3725 4 жыл бұрын
Very good - but extremely quick. I am unable to see the commands in the script before you skip to the next step. It helps if you can share this collection as a JSON for us to check the commands.
@vdespa
@vdespa 4 жыл бұрын
Sorry for that, I will keep that in find for future videos.
@hanumansays3725
@hanumansays3725 4 жыл бұрын
@@vdespa Thanks a lot for the response :)
@arshadsalmani9632
@arshadsalmani9632 2 жыл бұрын
Great video and information. I stuck in one place of API automation : I am getting an otp verification URL in one of my API response and I am opening the URL manually in one browser to enter the OTP, how to automate it because without automating this step my next request is failing. Please help me.
@vdespa
@vdespa 2 жыл бұрын
If you need manual intervention, you can't automate this with Postman. You may need to use another e2e tool like Cypress (or something) to do that UI interaction. Join the Discord community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.
@doyourworkout5608
@doyourworkout5608 3 жыл бұрын
Nice example but it gets a little messy if you have a very elaborate JSON body which you iteratively adapt according to a array (or multiple). Is it possible to use an external file for this as well? Let’s say CSV or XML?
@vdespa
@vdespa 3 жыл бұрын
This example assumes this data comes from another endpoint (I should have said that). You can use CSV or JSON. See other tutorials on this channel.
@too_quiet
@too_quiet 2 жыл бұрын
@Adam Schomaker As far my understanding it can only be achieved using Collection runner which might not make sense in a lot of cases tbh
@connorr3556
@connorr3556 2 жыл бұрын
I have thousands of JSON objects that I need to post to my Google Cloud Storage. When I run my collection following this guide, it takes a very long time to get every JSON object inside since each request is a single JSON object that takes 200 ms. Is there a way to speed this process up? Would it be something like batching the HTTP requests?
@1902garimatiwari
@1902garimatiwari 2 жыл бұрын
Hi Cannot Did you get the solution ? I also have a similar kind of issue.
@abhigupta9727
@abhigupta9727 4 жыл бұрын
Amazing video . Thank you ! Could you please confirm if you have video for reading the data sets from CSV/Spreadsheet for data driven automation ?
@vdespa
@vdespa 4 жыл бұрын
Yes. There should be at least one video on this topic.
@abhigupta9727
@abhigupta9727 4 жыл бұрын
@@vdespa - Thanks . Could you please point the video
@Fernandomoraissilva
@Fernandomoraissilva 3 жыл бұрын
Fiz a mesma coisa e não funcionou nada..
@lizalinnayak1029
@lizalinnayak1029 4 жыл бұрын
Thanks Valentine, I found it very useful..Also can it be possible with multiple services with different testdata run at a time?
@vdespa
@vdespa 4 жыл бұрын
Thanks for your comment. Can you give me an example. I don't know what you mean.
@lizalinnayak1029
@lizalinnayak1029 4 жыл бұрын
@@vdespa I was able to do it now by watching one of your video with CSV file.. Thanks for your response...👍
@chiranjibghorai6950
@chiranjibghorai6950 5 жыл бұрын
Excellent tutorial. Postman could simplify the workflow though, something like just executing a JSON of request strings and then generate an output file in the end
@vdespa
@vdespa 5 жыл бұрын
Sure, there are many ways. Please check the router tutorial. That one shows a different approach. Thanks for the comment.
@ManishBhati
@ManishBhati 6 жыл бұрын
hi @Valentin, I need to run a request URL (has dynamic values with simple auth) multiple times to get stats as 200, 400, 401, 404 on a single run. Please describe with an example
@ManishBhati
@ManishBhati 6 жыл бұрын
@@vdespa , ok I will try and I bought all your videos from Udemy
@w3worker
@w3worker 5 жыл бұрын
And what if we need to execute each company request at a time instead of requesting one by one? Actually i am working on a forex auto trading project and need to send buy requests to the websocket api server for multiple clients at a specific live market price at a time. And if it executes one after one as you described, means each client's buy requests will be at different market prices. Do u have any solution how to achieve? I am moving around batching MAP
@w3worker
@w3worker 5 жыл бұрын
@@vdespa Yes i know that... Asked u bcz i thought u might have any solution regarding my query. Currently i am using jQuery for my websockets but can also move to c# if that fix my issue. Waiting for ur valuable response...
@w3worker
@w3worker 5 жыл бұрын
@@vdespa oh okay
@antoniorodrigo897
@antoniorodrigo897 5 жыл бұрын
Works only if Collection Runner is used. Outside Collection Runner screen, test will run only once
@vdespa
@vdespa 5 жыл бұрын
This is expected as the Postman workflows can only work if you automate (Collection Runner, Newman).
@Kevin-ym3xg
@Kevin-ym3xg 2 жыл бұрын
REALLY THANKS
@vdespa
@vdespa 2 жыл бұрын
Most welcome
@scavalpha5211
@scavalpha5211 4 жыл бұрын
you Da MVP. thanks
@vdespa
@vdespa 4 жыл бұрын
Thanks!
@pearlking
@pearlking 3 жыл бұрын
Thank you very much!
@vdespa
@vdespa 3 жыл бұрын
You're welcome!
@akashkapoor3866
@akashkapoor3866 4 жыл бұрын
Getting error Cannot read property 'get' of undefined
@vdespa
@vdespa 4 жыл бұрын
Which Postman version are you using?
@Niyazakill
@Niyazakill 2 жыл бұрын
Hi, very useful but you missed one little part that makes it impossible to retry and repopulate the variables. You need to check in the if in the pre-request script : if(!companies || companies.length==0) Without the last part, the next run will have "[]" as companies and the if statement will be false as an empty array is set and is not null.
@vdespa
@vdespa 2 жыл бұрын
Yes, this is a valid point. The script could be improved, the concept is largely the same.
@davidjunghan91
@davidjunghan91 4 жыл бұрын
This is awesome
@vdespa
@vdespa 4 жыл бұрын
Thank you for your comment!
@ThiagoSPassos
@ThiagoSPassos 5 жыл бұрын
Great video! Thanks for sharing.
@dhavaljardosh
@dhavaljardosh 5 жыл бұрын
How can I pass a whole object as variable instead of just passing it as a value in Key-Value pair? What I mean is instead of passing ----- "name": {{companies}} ------- . can I pass only ----- {{company_object}} ------, where company_object = {"name": "Company Name"}..
@brpctips
@brpctips 6 жыл бұрын
Great Video!!!!!!! Thanks for the tips!!
@apnvinobala1
@apnvinobala1 5 жыл бұрын
Nice, in mobile its not visiable. Kindly post the script
@jgowrri
@jgowrri 6 жыл бұрын
Very thanks. I was trying the similar concept and got stuck you helped me. Btw how do we define pm.environment? i am using the full syntax all the time?
@ShaikSameer549
@ShaikSameer549 2 жыл бұрын
Thanks for sharing
@vdespa
@vdespa 2 жыл бұрын
Thanks for watching!
@ezekieludoh6735
@ezekieludoh6735 5 жыл бұрын
Hi Valentin, thanks for the tutorial. It was awesome. I guess what I would need some pointers on is how to write tests for each new NAME you are passing into theAPI requests. Something like: if the name is "Google", assert the response is 200, if the name is "Facebook", assert the response is 409. How can I loop through tests per request value?
@vdespa
@vdespa 5 жыл бұрын
Thank you for your comment. You just need to replace 200 with a variable. This will help make your tests dynamic.
@ezekieludoh6735
@ezekieludoh6735 5 жыл бұрын
@@vdespa Thanks for that pointer. I may as well declare an array of responses that match my array of inputs. This way, I can use the same SHIFT method to assert the expected result...
@jlwasmer
@jlwasmer 6 жыл бұрын
Skip to 2:45
@alextreme98
@alextreme98 6 жыл бұрын
Put the request name inside the setNextRequest surrounded by ' ' not " " ... it won't work otherwise
@daniyaniazics
@daniyaniazics Жыл бұрын
My api is running only 1 time
@MaximeBodivit
@MaximeBodivit 5 жыл бұрын
Thanx Valentin ;) !
@zienunyei1614
@zienunyei1614 6 жыл бұрын
Hello, I have done the steps in this example but it only seems to be sending one company at a time. It doesn't loop until it becomes invalid. Am i doing something wrong? **PRE-REQUEST SCRIPT** var companies = pm.environment.get("companies"); if (!companies) { companies = ["Goooooooooogle", "Yahoo!", "Facebook", "Amazon", "Currys", "Orion", "Zienu"]; } var currentCompany = companies.shift(); pm.environment.set("company", currentCompany); pm.environment.set("companies", companies); **TESTS** var companies = pm.environment.get("companies"); if (companies && companies.length >0){ pm.sendRequest("postb.in/5HXHKNhQ", function (err, response) { console.log(response.json); }); } else { pm.sendRequest(null); }
@zienunyei1614
@zienunyei1614 6 жыл бұрын
@@vdespa the postman.setNextRequest didn't work for me
@akashkapoor3866
@akashkapoor3866 4 жыл бұрын
I'm getting error - Cannot read property 'get' of undefined. Please help
@Danish-797
@Danish-797 4 жыл бұрын
Same issue with me, Only one company from array is getting picked and run, it doesn't run for other.
@nuriagonzalez7674
@nuriagonzalez7674 4 жыл бұрын
@@Danish-797 I have same error, Does somebody know why?
@archanashinde8029
@archanashinde8029 4 жыл бұрын
same foe me it works for only one element from array. Please reply with solution
@nithyaraji7694
@nithyaraji7694 6 жыл бұрын
Great video, Thanks! I've my tests and pre-requisite scripts, after i go to Runner, select the collection and I let the Iterations=1 and the test just run only one time. If i change the iterations to 3 then the first value from the array is only getting executed 3 times, none of the other values are getting picked up. Please advise. *My Prerequisite script : * var states = pm.environment.get("states"); if (!states){ var states = ["TX", "GU", "AK"]; } var currentState = states.shift(); pm.environment.set("stateUS", currentState); pm.environment.set("states", states); *My Test : * var states = pm.environment.get("states"); if (states && states.length > 0) { postman.setNextRequest("My request url"); console.log("Executed"); } else { postman.setNextRequest(null); } Note: the values from "states" variable should be sequentially entered in one of the headers and response will be validated in the Tests.
@nuriagonzalez7674
@nuriagonzalez7674 4 жыл бұрын
I have the same problem. 1 iteration--> only one test but my array have 3 elements
@archanashinde8029
@archanashinde8029 4 жыл бұрын
same with me I have 3 elements in array , but while executed only one is executed
@patrykjanka
@patrykjanka 4 жыл бұрын
@@archanashinde8029 Try this: find the name of your request (it is highlighted in Collections list (after POST) then in Tests under "if" put postman.setNextRequest("NAME_OF_YOUR_REQUEST");
@marianamontenegro77
@marianamontenegro77 4 жыл бұрын
@@patrykjanka I have the same problem. I put the name of the request but it didn't work
@christopherhoup3531
@christopherhoup3531 2 жыл бұрын
@@patrykjanka This worked for me! Thank you!
@dickshachohan3583
@dickshachohan3583 6 жыл бұрын
Thanks for this video. It helps alot!!! I have a doubt, Now I have 2 variables (list) instead of 1 (list) (in your case companies) . I want to send the variable to body section one by one . I have tried but not able to do. Could you please help me.. Thanks in advance!!!
@dickshachohan3583
@dickshachohan3583 6 жыл бұрын
@@vdespa now in my body section there are 2 variables instead of 1 like in your case it is company and in my case time period and role. how i can send these 2 variable in nested loop like for 1 time period all roles will go and then for 2nd time period all the roles will go again. Thanks in advance!!
@dickshachohan3583
@dickshachohan3583 6 жыл бұрын
@@vdespa i tried it but somewhere i am going wrong.. It would be great if you could help me. Thanks in advance!!!
@DrFearrr
@DrFearrr 5 жыл бұрын
This can be done much simpler. Just add csv file as Data in Postman Collection Runner. The csv should contain only one column - "company" with all the values And there you go. No pre or test scripts are needed.
@vdespa
@vdespa 5 жыл бұрын
Sure. This example is useful if you don't know the data in advance. For example if it comes from the response of a previous request.
@CodeByB
@CodeByB 3 жыл бұрын
Thanks
@vdespa
@vdespa 2 жыл бұрын
You are welcome!
@Pativerus
@Pativerus 5 жыл бұрын
Thanks!
@federicovalerin1444
@federicovalerin1444 5 жыл бұрын
Pretty unnatural for a tool used by hundreds of companies and thousands of developers. And pretty industrious. What if you have 100 urls to automate, not 100 but 50, what if you have 100 values for one url, you will have to create an array with 100 values, pretty uncomfortable too. This is one of those features that could be so naturally embedded on the app, but for some reason is not, like Microsoft they just decide that something that should be so easy must be difficult and time consuming.
@alinalipova6974
@alinalipova6974 3 жыл бұрын
Hi, Valentin! Can you help me pls, what if in "companies" instead of array ["name1", "name2"] i would like to get Environment Variable with array of numbers (in my case) that looks like [1,2,3] and i want my requests to loop through this array, if i simply put in "companies" : pm.environment.get("my variable"); all i get is all array in my request body parametr
@vdespa
@vdespa 3 жыл бұрын
Sorry for the late reply. Are you still facing this problem? Maybe you can join Discord and ask there.
Loop request based on data from response in Postman
13:13
Valentin Despa
Рет қаралды 62 М.
Data-driven testing with different data sets for each request
16:48
Valentin Despa
Рет қаралды 17 М.
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
API Testing using POSTMAN - Advance Test Cases
10:17
ItsTechMode
Рет қаралды 62 М.
Data-driven testing using Postman
13:37
Valentin Despa
Рет қаралды 60 М.
JSON Schema validation in Postman
9:29
Valentin Despa
Рет қаралды 48 М.
New to Postman Part 5: chaining requests
9:00
Postman
Рет қаралды 51 М.
How write API Tests with Postman in 3 easy steps
18:49
Valentin Despa
Рет қаралды 163 М.
How to reuse Postman scripts and tests among different test cases
10:31