More Useful and thanks for covering the scenario which I am looking for, Much Appreciated
@vdespa2 жыл бұрын
Glad it was helpful! You are welcome.
@apekshapatel88552 жыл бұрын
Thank you very much!! this is exactly I am looking....getting after a lot of searches.
@vdespa2 жыл бұрын
Glad I could help! You are welcome. Thank you for leaving a comment.
@AlessiaCaraFans Жыл бұрын
is it possible to do the same without collection runnet , just scripts in postman ? to save multiple datasets from csv file?
@sowmyakalvagadda67115 жыл бұрын
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
@sowmyakalvagadda67115 жыл бұрын
I changed the iteration number to multiple times in collection runner and it's accepting multiple values in arrray. Does this make sense?
@Danish-7974 жыл бұрын
@@sowmyakalvagadda6711 : this wont help, your solution to set the iteration doesn't solve the purpose.
@jigneshpatel1474 жыл бұрын
yes same-thing for me. it's run only once
@wanderincanada3332 жыл бұрын
Changing iteration number helped me
@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Ай бұрын
@@matthewmurnaghan4473 Great 👍 thanks for sharing.
@simplearora12233 жыл бұрын
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?
@vdespa3 жыл бұрын
As the error says, you probably did not write any tests for the request.
@simplearora12233 жыл бұрын
@@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.
@pearlking3 жыл бұрын
@@vdespa For me also it showed the same message but the multiple post operation also worked as expected.
@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 Жыл бұрын
"No tests found" appears when there are no tests.
@yogitzz.kulawade25310 ай бұрын
I also faced the same issue: it shows no tests
@sibanidevi9306 ай бұрын
I am unable to pass multiple values using the approach mentioned in the video ,its only executing first value provided once only
@meandherforeternity Жыл бұрын
What should i do when i have multiple variables to be changed. Example company name and address
@rallysahil6 ай бұрын
HOw can I execute same api with diiferent files in a folder. Each file is selected in the upload field as binary data ?
@ankurvishwakarma77763 жыл бұрын
Hey, it is not working for multiple iterations if there is only single request in the collection
@theraahi_in3 жыл бұрын
Short and crisp. Thank you! :)
@vdespa3 жыл бұрын
I am glad it matched your expectations. Thanks
@VictorDabela5 жыл бұрын
Great video! It helped me a lot to solve some massive integration problem with multiple customers. Thanks!
@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
@jackofalltrademasterofsome5 жыл бұрын
Excellent one. Helped me in a very tight situation. Thanks.
@vdespa5 жыл бұрын
Glad to hear that! Thank you for your comment.
@OliverUnderTheMoon6 жыл бұрын
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-clouds3 жыл бұрын
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?
@vdespa3 жыл бұрын
Have you tried using a variable to store the last entry number?
@gattupalli6904 жыл бұрын
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
@vdespa4 жыл бұрын
Glad it helped.
@dimakatsomashao34834 жыл бұрын
Please help i want to chieve the same thing
@harshshukla5692 жыл бұрын
Great Tutorial, this was super helpful!
@vdespa2 жыл бұрын
Glad it was helpful!
@patriciapaez3233 Жыл бұрын
Thank you very much. Do you have some material for learning how to make concurrent multiple requests? Thanks in advance.
@1902garimatiwari2 жыл бұрын
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.
@varalikaagarwal44773 жыл бұрын
Hey , I need to convert the string which I am passing in base 64 ,so how can i send multiple data with base 64.
@vdespa3 жыл бұрын
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.
@LaTernurin4 жыл бұрын
Michas gracias, me ayudo mucho con este ejemplo para aplicarlo. Excelente tutorial
@vdespa4 жыл бұрын
¡Gracias por tu comentario! Me alegro de que el tutorial haya sido útil.
@poojanimodiya79984 жыл бұрын
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.
@vdespa4 жыл бұрын
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.
@nghiavoai79934 жыл бұрын
Thank you very much, this is the exactly what tip I need right now!
@vdespa4 жыл бұрын
Great to hear!
@RoryGaddin4 жыл бұрын
Thanks Valentin, I found this tutorial very useful. Well explained and easy to follow.
@vdespa4 жыл бұрын
I am glad it was helpful, Rory! Thanks for your comment.
@ChandraSekhar00854 жыл бұрын
Thanks Valentin. Very useful one
@vdespa4 жыл бұрын
Thanks
@jpeca135 жыл бұрын
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.
@vdespa5 жыл бұрын
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.
@vdespa4 жыл бұрын
Download the FREE Postman Quick Reference Guide 👉 www.subscribepage.com/postman
@Red999u3 жыл бұрын
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?
@vdespa3 жыл бұрын
Sorry, I don't use Insomnia.
@MsTwte4 жыл бұрын
@ 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
@vdespa4 жыл бұрын
Glad you have found a solution. Thanks for letting me know.
@sukanyashide91883 жыл бұрын
#need help Instead of uploading files during Run, can we provide a URL so every time I don't need to upload files?
@vdespa3 жыл бұрын
If you are testing a file upload, you need to actually upload a file otherwise your test is useless.
@amitmokashi23884 жыл бұрын
Do you know, if we can pass elements from excel file & verify against another excel file?
@vdespa4 жыл бұрын
I don' thinks would be possible.
@srikanthkorada5082 жыл бұрын
@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.
@vdespa2 жыл бұрын
If you need to add multiple values to same variable, you may want to use an array to store this.
@lucaspiresnabais8774 жыл бұрын
Is there a way to do this exact same but using the console runner newman?
@vdespa4 жыл бұрын
Yes, you can also use newman for this.
@christopherhoup35312 жыл бұрын
I have followed your example exactly as you've coded, but my post only runs once and stops after Google.
@vdespa2 жыл бұрын
Use console.log to debug your script.
@1241GIBEK3 жыл бұрын
I got error ' the request does not have any test '
@hairdryerjukebox Жыл бұрын
Would you recommend this technique when testing for different result codes? E.g. Checking 200, 401, 404 based on parameter values.
@ankajgoyal81975 жыл бұрын
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
@zeenatahmed5984 жыл бұрын
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
@vdespa4 жыл бұрын
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.
@meandherforeternity2 жыл бұрын
Awesome. You saved my day, liked and subscribed your channel :)
@vdespa2 жыл бұрын
Glad I could help! You are welcome. Thank you for leaving a comment.
@merajulhaque91074 жыл бұрын
postman.setNextRequest("xyz") throwing BAD Request 400, please suggest
@sumitpatra24183 жыл бұрын
How do I login to a page with different usernames and passwords
@vdespa3 жыл бұрын
Maybe Postman is not the best tool for the job.
@sumitpatra24183 жыл бұрын
@@vdespa If I am to try the above on Postman, is there a way ?
@victorregoz5 жыл бұрын
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.
@victorregoz5 жыл бұрын
@@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!
@chauhanvipul20093 жыл бұрын
Excellent Brother.
@vdespa2 жыл бұрын
Thank you. I really appreciate it.
@pandemonium82764 жыл бұрын
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
@vdespa4 жыл бұрын
Please check again your code. This should still work.
@manikandanp24094 жыл бұрын
@@vdespa Yes, i just verified and working.
@manikandanp24094 жыл бұрын
I did a mistake too. That was postman.sendNextRequest("reqName") instead of postman.setNextRequest("reqName");
@subashskj834 жыл бұрын
in the Data Set Result, why the PASSED and FAILED is ZERO??
@vdespa4 жыл бұрын
Good question. This is because I haven't written any tests.
@hanumansays37254 жыл бұрын
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.
@vdespa4 жыл бұрын
Sorry for that, I will keep that in find for future videos.
@hanumansays37254 жыл бұрын
@@vdespa Thanks a lot for the response :)
@arshadsalmani96322 жыл бұрын
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.
@vdespa2 жыл бұрын
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.
@doyourworkout56083 жыл бұрын
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?
@vdespa3 жыл бұрын
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_quiet2 жыл бұрын
@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
@connorr35562 жыл бұрын
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?
@1902garimatiwari2 жыл бұрын
Hi Cannot Did you get the solution ? I also have a similar kind of issue.
@abhigupta97274 жыл бұрын
Amazing video . Thank you ! Could you please confirm if you have video for reading the data sets from CSV/Spreadsheet for data driven automation ?
@vdespa4 жыл бұрын
Yes. There should be at least one video on this topic.
@abhigupta97274 жыл бұрын
@@vdespa - Thanks . Could you please point the video
@Fernandomoraissilva3 жыл бұрын
Fiz a mesma coisa e não funcionou nada..
@lizalinnayak10294 жыл бұрын
Thanks Valentine, I found it very useful..Also can it be possible with multiple services with different testdata run at a time?
@vdespa4 жыл бұрын
Thanks for your comment. Can you give me an example. I don't know what you mean.
@lizalinnayak10294 жыл бұрын
@@vdespa I was able to do it now by watching one of your video with CSV file.. Thanks for your response...👍
@chiranjibghorai69505 жыл бұрын
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
@vdespa5 жыл бұрын
Sure, there are many ways. Please check the router tutorial. That one shows a different approach. Thanks for the comment.
@ManishBhati6 жыл бұрын
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
@ManishBhati6 жыл бұрын
@@vdespa , ok I will try and I bought all your videos from Udemy
@w3worker5 жыл бұрын
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
@w3worker5 жыл бұрын
@@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...
@w3worker5 жыл бұрын
@@vdespa oh okay
@antoniorodrigo8975 жыл бұрын
Works only if Collection Runner is used. Outside Collection Runner screen, test will run only once
@vdespa5 жыл бұрын
This is expected as the Postman workflows can only work if you automate (Collection Runner, Newman).
@Kevin-ym3xg2 жыл бұрын
REALLY THANKS
@vdespa2 жыл бұрын
Most welcome
@scavalpha52114 жыл бұрын
you Da MVP. thanks
@vdespa4 жыл бұрын
Thanks!
@pearlking3 жыл бұрын
Thank you very much!
@vdespa3 жыл бұрын
You're welcome!
@akashkapoor38664 жыл бұрын
Getting error Cannot read property 'get' of undefined
@vdespa4 жыл бұрын
Which Postman version are you using?
@Niyazakill2 жыл бұрын
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.
@vdespa2 жыл бұрын
Yes, this is a valid point. The script could be improved, the concept is largely the same.
@davidjunghan914 жыл бұрын
This is awesome
@vdespa4 жыл бұрын
Thank you for your comment!
@ThiagoSPassos5 жыл бұрын
Great video! Thanks for sharing.
@dhavaljardosh5 жыл бұрын
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"}..
@brpctips6 жыл бұрын
Great Video!!!!!!! Thanks for the tips!!
@apnvinobala15 жыл бұрын
Nice, in mobile its not visiable. Kindly post the script
@jgowrri6 жыл бұрын
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?
@ShaikSameer5492 жыл бұрын
Thanks for sharing
@vdespa2 жыл бұрын
Thanks for watching!
@ezekieludoh67355 жыл бұрын
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?
@vdespa5 жыл бұрын
Thank you for your comment. You just need to replace 200 with a variable. This will help make your tests dynamic.
@ezekieludoh67355 жыл бұрын
@@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...
@jlwasmer6 жыл бұрын
Skip to 2:45
@alextreme986 жыл бұрын
Put the request name inside the setNextRequest surrounded by ' ' not " " ... it won't work otherwise
@daniyaniazics Жыл бұрын
My api is running only 1 time
@MaximeBodivit5 жыл бұрын
Thanx Valentin ;) !
@zienunyei16146 жыл бұрын
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); }
@zienunyei16146 жыл бұрын
@@vdespa the postman.setNextRequest didn't work for me
@akashkapoor38664 жыл бұрын
I'm getting error - Cannot read property 'get' of undefined. Please help
@Danish-7974 жыл бұрын
Same issue with me, Only one company from array is getting picked and run, it doesn't run for other.
@nuriagonzalez76744 жыл бұрын
@@Danish-797 I have same error, Does somebody know why?
@archanashinde80294 жыл бұрын
same foe me it works for only one element from array. Please reply with solution
@nithyaraji76946 жыл бұрын
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.
@nuriagonzalez76744 жыл бұрын
I have the same problem. 1 iteration--> only one test but my array have 3 elements
@archanashinde80294 жыл бұрын
same with me I have 3 elements in array , but while executed only one is executed
@patrykjanka4 жыл бұрын
@@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");
@marianamontenegro774 жыл бұрын
@@patrykjanka I have the same problem. I put the name of the request but it didn't work
@christopherhoup35312 жыл бұрын
@@patrykjanka This worked for me! Thank you!
@dickshachohan35836 жыл бұрын
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!!!
@dickshachohan35836 жыл бұрын
@@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!!
@dickshachohan35836 жыл бұрын
@@vdespa i tried it but somewhere i am going wrong.. It would be great if you could help me. Thanks in advance!!!
@DrFearrr5 жыл бұрын
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.
@vdespa5 жыл бұрын
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.
@CodeByB3 жыл бұрын
Thanks
@vdespa2 жыл бұрын
You are welcome!
@Pativerus5 жыл бұрын
Thanks!
@federicovalerin14445 жыл бұрын
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.
@alinalipova69743 жыл бұрын
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
@vdespa3 жыл бұрын
Sorry for the late reply. Are you still facing this problem? Maybe you can join Discord and ask there.