How write API Tests with Postman in 3 easy steps

  Рет қаралды 162,618

Valentin Despa

Valentin Despa

6 жыл бұрын

👉 Want to learn more about Postman? Check my Postman online course.
vdespa.com/courses/?q=KZfaq
___
// A B O U T T H I S V I D E O
In this series of tutorials, you will learn how to write API tests with Postman.
___
// I H A V E A Q U E S T I O N!
I do my best to answer all comments here on KZfaq but I cannot make any guarantees.
If you have a question, it is best to ask your question on the Postman User Group on Facebook or on the Postman Community (links below).
If you have purchased the Postman online course, please use the Q&A section or send me a message on Udemy.
Please do not email me or contact me on other channels as I might not be able to answer. Sorry!
___
// I H A V E A V I D E O I D E A
Do you want me to create a video on a specific topic? Just fill out the form below:
forms.gle/uWEzXFQ2viJtZtvZ7
___
// P L A Y L I S T S
Collection of video tutorials:
▸ Learn Postman | bit.ly/2CFaf70
▸ Postman Crash Course | bit.ly/2YwEBBT
▸ Postman Tips & Tricks | bit.ly/2JLkXyU
___
// F R E E R E S O U R C E S
▸▸▸ DOWNLOAD the FREE Postman Quick Reference Guide
postman-quick-reference-guide...
▸▸▸ JOIN the Postman User Group on Facebook
bit.ly/2OutAMZ
▸▸▸ OFFICIAL Postman community forum
community.getpostman.com/
___
// M U S I C C R E D I T S
Dreams by Joakim Karud / joakimkarud
Creative Commons - Attribution-ShareAlike 3.0 Unported- CC BY-SA 3.0
creativecommons.org/licenses/...
Music promoted by Audio Library • Video
___
// IMPRINT
vdespa.de/imprint
___

Пікірлер: 113
@renemandiangu1890
@renemandiangu1890 5 жыл бұрын
Valentin, you are the best. You explain things the simplest way. Keep up the good work. Thanks.
@sameernaqvi1751
@sameernaqvi1751 6 жыл бұрын
The best video on API testing on youtube, your explanation is superb..
@MaheshJoshi_wellington
@MaheshJoshi_wellington 6 жыл бұрын
You are the best API tutor I found on youtube hats of to you.. Keep it up
@MaheshJoshi_wellington
@MaheshJoshi_wellington 6 жыл бұрын
Valentin Despa your most welcome I am waiting for next 3 parts now ..:)
@thomasfranz4826
@thomasfranz4826 6 жыл бұрын
Very smart guy, this is how it should be. He speaks normaly, you can learn something because his speech has beginning and end with idea inside. Thumbs up!
@nadeem2sparkle2005
@nadeem2sparkle2005 6 жыл бұрын
Appreciate your patience and eagerness to share knowledge, well done.
@mariiakit4830
@mariiakit4830 5 жыл бұрын
Valentin, thanks to you I've created the test to verify that boolean true returns!! I don't even know javascript!
@joshuakincheloe
@joshuakincheloe 5 жыл бұрын
Bought your course as I am jumping into the world of headless CMS, and saw myself going WTH do I do now. You allowed me to understand what I was in for and I appreciate your work Valentin. Thank you!
@rahulmehta27
@rahulmehta27 4 жыл бұрын
Please subscribe my channel. I will be uploading all the api related topic part by part. kzfaq.info/get/bejne/pKeVe8Ri2LPPoGQ.html
@prashantkatti
@prashantkatti 4 жыл бұрын
Very well taught in the video. I am active member and follower of your course now.
@shikhaawasthi5333
@shikhaawasthi5333 4 жыл бұрын
Really helpful videos. You covered basics in crisp and simple way. Thanks.
@vdespa
@vdespa 4 жыл бұрын
You are welcome. Thanks for letting me know
@Mohamed-uf5jh
@Mohamed-uf5jh 5 жыл бұрын
Great Job Valentin ,I am discovering Postman , it not just an test api ,It's more wow
@williamstings
@williamstings 3 жыл бұрын
After going through countless stackoverflow threads this video taught me what i needed in a few minutes. Awesome content!
@Richa801
@Richa801 6 жыл бұрын
Thank you for the awesome video.. making learning easy
@mikeroberts6203
@mikeroberts6203 4 жыл бұрын
Thanks!! That was very helpful. Had some requests built out in Postman and was curious about the testing side... this video made it easy to write my first few tests
@rahulmehta27
@rahulmehta27 4 жыл бұрын
Please subscribe my channel. I will be uploading all the api related topic part by part. kzfaq.info/get/bejne/pKeVe8Ri2LPPoGQ.html
@ardit9988
@ardit9988 2 жыл бұрын
🇬🇧🇬🇧🇽🇰🇽🇰🦋🦋💫
@ON-zd3vf
@ON-zd3vf 5 жыл бұрын
This was excellent. Thanks!
@yuwenpixon
@yuwenpixon 4 жыл бұрын
very clear tutorial. Thanks man!
@vdespa
@vdespa 4 жыл бұрын
You're welcome!
@eliasshikhalshabab805
@eliasshikhalshabab805 4 жыл бұрын
That's really an awesome tutorial to explain how to write a simple test on Postman. Thanks alot
@rahulmehta27
@rahulmehta27 4 жыл бұрын
Please subscribe my channel. I will be uploading all the api related topic part by part. kzfaq.info/get/bejne/pKeVe8Ri2LPPoGQ.html
@vdespa
@vdespa 4 жыл бұрын
Download the FREE Postman Quick Reference Guide 👉 www.subscribepage.com/postman
@isamorita8647
@isamorita8647 5 жыл бұрын
Thank u!! great tutorial
@Gabe9408
@Gabe9408 5 жыл бұрын
let jsonData = pm.response.json(); pm.test("Check for JSON body", function () { pm.expect(jsonData.headers['Cache-Control']).to.eql("no-cache"); }); No need for the Postman course! I already purchased your Udemy video thanks !!
@geryvanegas1
@geryvanegas1 5 жыл бұрын
Your videos are a blessing, thank you VERY MUCH. I'm gonna be the first one to answer the challenge on the video: pm.expect(jsonData.headers["Cache-Control"]).to.eql("no-cache"); I had a hard time finding out why a dash was not accepted as a JSON variable, even that challenge was very instructive. thanks again.
@pogothemonkey7461
@pogothemonkey7461 5 жыл бұрын
Valentin, could you please comment on this? I would like to know where I can find the information/theory that explains what to do in this case, meaning, the logic behind putting the [square brackets] because without looking for the answer I would never have guessed my way past the error message (due to my parameter not being "accepted").
@amanpathania
@amanpathania 2 жыл бұрын
@@pogothemonkey7461 "Cache-Control" has a "-" and in order to pass cache control as a single value, you would have to use ["Cache-Control"]
@bolexi7902
@bolexi7902 2 жыл бұрын
Thank You for this one, I never needed to search elsewhere :)
@anna-iz5op
@anna-iz5op Жыл бұрын
It doesn't work for me. "headers" is faded and I get an answer: Your test name | AssertionError: expected undefined to deeply equal 'no-cache'.
@celiadallel2749
@celiadallel2749 2 жыл бұрын
Thank you so much for all! You are THE BEST
@vdespa
@vdespa 2 жыл бұрын
Thanks, Celia!
@vinayam4080
@vinayam4080 3 жыл бұрын
Very Good tutorial... Thank you for your efforts...
@vdespa
@vdespa 3 жыл бұрын
I am glad it helped. Thanks for letting me know.
@lizalinnayak1029
@lizalinnayak1029 4 жыл бұрын
Thank you so much ... Really helped me a lot...
@vdespa
@vdespa 4 жыл бұрын
I am glad to hear that, thank you!
@JenniferAChannel
@JenniferAChannel Жыл бұрын
What a great explanation!!
@vdespa
@vdespa Жыл бұрын
Glad you think so! You are welcome. Thank you for leaving a comment.
@abdelrahmanatef2325
@abdelrahmanatef2325 5 жыл бұрын
Keep it up its great tutorial
@rodybothe3329
@rodybothe3329 6 жыл бұрын
Good explanation :)
@DebashishP82
@DebashishP82 6 жыл бұрын
Excellent article mate. Really love you explain things. Cheers. One more thing I am trying to write the code to count the number of arrays in a response. can you please guide me on this if there is any link to refer. Regards Deb
@janetgardner1105
@janetgardner1105 6 жыл бұрын
Great Job
@zxcvmjg
@zxcvmjg 5 жыл бұрын
Nice tutorial!!
@harmeets375
@harmeets375 4 жыл бұрын
Great Learning...
@vdespa
@vdespa 4 жыл бұрын
Thank you very much!
@codelaravel
@codelaravel Жыл бұрын
Great work 👍
@vdespa
@vdespa Жыл бұрын
Thank you! Cheers!
@isratnilu2791
@isratnilu2791 2 жыл бұрын
Thanks for this video.
@vdespa
@vdespa 2 жыл бұрын
You are welcome. Thank you for leaving a comment.
@isratnilu2791
@isratnilu2791 2 жыл бұрын
@@vdespa I like your tutorial. Easy to understand. Now I am working on postman. Your vedios made me make scenes. Thanks
@Julie_withoutRomeo
@Julie_withoutRomeo Жыл бұрын
Thanks for your videos Valentin, enjoying it from Nigeria . But can one push their API from postman to GitHub??
@mayurshankar3181
@mayurshankar3181 4 жыл бұрын
wowowowowowowowoowow Valentinnnnnnnnnn Genuius Man!
@vdespa
@vdespa 4 жыл бұрын
Thanks!
@anshikaagarwal9493
@anshikaagarwal9493 2 жыл бұрын
Hi! your videos are amazing. But have a request can u make a video on supertest
@vdespa
@vdespa 2 жыл бұрын
Thanks for your kind words. Are you looking for an introduction to supertest or what exactly?
@Arqu07
@Arqu07 5 жыл бұрын
I haven't noticed any solution yet for the assignment so I am posting mine: pm.test("assignment", function () { pm.expect(jsonData.headers["Cache-Control"]).to.eql("no-cache"); });
@Arqu07
@Arqu07 5 жыл бұрын
@@vdespa Thank you, but anyway it's too late to receive a prize? :P
@siddharthau489
@siddharthau489 Жыл бұрын
Thanks for the detailed explanation. Can we write a pre request script to upload an image file as binary in the Body of the request? I have an api in which I upload the image binary in the body before sending the request. I'm trying to validate this through script. Could you please guide me how to write the script for this. Thank You.
@vdespa
@vdespa Жыл бұрын
You're welcome! You can't access the filesystem from scripts.
@emiliozelarayan2306
@emiliozelarayan2306 2 жыл бұрын
Nice
@vdespa
@vdespa 2 жыл бұрын
Great! Thank you.
@harishshet7268
@harishshet7268 4 жыл бұрын
Hey Thanks for the video, I am stuck here I want to execute redis lpush via postman, means I want to directly push some contents into redis db, Can you tell me how we can connect to REDIS DB via postman and do the lpush? Thanks
@vdespa
@vdespa 4 жыл бұрын
Hi. Did you check if your Redis installation has a REST API?
@venkateshramachandran2579
@venkateshramachandran2579 3 жыл бұрын
I watched this vide many times. thank you for the clear explanation....But I am trying to execute a test case for Response body value check. But in my API url instead of string i have a array of values ( (6) [{..}, {..}.....] ... How can I do this ?
@vdespa
@vdespa 3 жыл бұрын
You need to learn about arrays and objects in JavaScript.
@NehaKumari-hn4uk
@NehaKumari-hn4uk Жыл бұрын
What kind of test case we can design for student roll no ,name,class,age this was asked by one interviewer I didn't answered so can you tell
@nithyaraji7694
@nithyaraji7694 5 жыл бұрын
Tutorial is very much helpful. But in my case the property name is "0" in place of "args:" in your video, but am not allowed to enter ".0" in my tests like "jsondata.0", could you please tell me how to resolve this?
@nithyaraji7694
@nithyaraji7694 5 жыл бұрын
@@vdespa , Yes it worked.. Thank you so much..!!
@marcussmith2006
@marcussmith2006 5 жыл бұрын
@Valentin Despa Great video - as for the contest - please see my working answer ! pm.test("Test Header Cache-Control value for Valentin's competition", function () { pm.expect(pm.request.headers.get('Cache-Control')).to.eql('no-cache'); });
@marcussmith2006
@marcussmith2006 5 жыл бұрын
@@vdespa thanks Valentine - love your videos - as I've answer the competition correctly do i still win a copy of your course?
@parulgrover8161
@parulgrover8161 3 жыл бұрын
Thank you for this vedio !! please let me know that is it necessary to learn javascript to write tests for POSTMAN, I am from Manual testing background, Please suggest.
@vdespa
@vdespa 3 жыл бұрын
It won't hurt if you know some basics around Javascript.
@parulgrover8161
@parulgrover8161 3 жыл бұрын
Will learn thank you for the reply:)
@nadeem2sparkle2005
@nadeem2sparkle2005 6 жыл бұрын
This is how I think: let jsonData = pm.response.json() pm.test("Header Test", function(){ pm.expect(jsonData.headers.Cache-Control).to.eql('no-cache'); });
@mamdohlotfy3459
@mamdohlotfy3459 4 жыл бұрын
Link to download the quick reference is not working can you check please...thanks a lot
@vdespa
@vdespa 4 жыл бұрын
Thank you for letting me know. I have updated the link.
@RakeshBitling
@RakeshBitling 3 жыл бұрын
Nice video link is paid..pls share free url ..loved your explanation
@vdespa
@vdespa 3 жыл бұрын
Place subscribe to the KZfaq channel for more free tutorials.
@bibilebaby
@bibilebaby 3 жыл бұрын
The ending made me nervous,,,,Good explanation tho,thanks a lot
@vdespa
@vdespa 3 жыл бұрын
😂 thanks for watching. I am glad it was useful.
@silverpizza8812
@silverpizza8812 5 жыл бұрын
Great video, thanks! Anyone know why when I try to print like this is doesn't work--> console.log(jsonData.headers.Cache-Control); ...but this one does? --> console.log(jsonData.headers['Cache-Control']);
@silverpizza8812
@silverpizza8812 5 жыл бұрын
@@vdespa Hey, thanks for the reply! Really enjoying your videos. I'm interested in your course but not sure it will cover what I need to do: I need to automate comparing the responses of 2 APIs, ie same service in different environments. Do you cover anything like that? Either way, thanks a lot for your help!
@silverpizza8812
@silverpizza8812 5 жыл бұрын
@@vdespa Ok. I guess a better question is--do you think there's any obvious reason I wouldn't be able to do that? I think it should work & think I almost have it... anyway, is there a way for me to donate or should I just buy your class to give you something back? You've already helped me a lot & I appreciate it--thank you sir.
@nageshkp4768
@nageshkp4768 3 жыл бұрын
Hello Valentin, I have a response from postman in binary format and the content type is application/x-protobuf. How can I convert the binary format to json? Below is the format and is of about 150-200 lines. �ʠ ������" Current-Roughness" Long-term-Roughness* ��&�\�>���>ޛ=@* �ԍ���>1
@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.
@Daidera91
@Daidera91 5 жыл бұрын
I like postman but still don't see the value in the javascript testing. If i e.g. write my api in Golan, why shouldn't i test it using Golang native testing libraries like Ginkgo? When i gave the postman testing i try i stumbled upon very basic scenarios where the testing from the app is not working for me. Imagine testing an endpoint that creates a user. If i fill in my test with a demo user name and run it twice, the API will respond the second time with an error code because this user is already existing. I am not able to run a setup or teardown functions that actually cleanups my test database for every unit test.
@syedhashim82
@syedhashim82 3 жыл бұрын
AssertionError: expected undefined to deeply equal 'no-cache' The response does not include Cache-Control header. @Valentin Despa please help me out.
@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.
@hollyshmit9956
@hollyshmit9956 5 жыл бұрын
Kay....so, imma loving tis IP And waz thinkin' bout doin BCA bla blah(I need to research some more aye!?) Imma kinda lost.... I wanna Ave a job which ain't no consist of deep mathematics or tooooo much theory..... I love computers(I sound like... 5?). Yeah so uh, suggest me wtf do I do bro/dude/sis/stranger anyone out there with experience!!! ... Oh nd imma in 12th in commerce(consist of economics, accounts, business studies, informatics practices, english)... Let me rephrase the 2nd para or was it 3rd above? I wanna Ave Profesional degree first and a damn well respectable, lil fun, good pay job in future...
@LFF___
@LFF___ 3 жыл бұрын
for anyone wondering for solution: let jsonData = pm.response.json(); pm.test("Your test name", function () { pm.expect(jsonData.headers.Cache-Control).to.eql('no-cache'); }];
@vdespa
@vdespa 3 жыл бұрын
Thanks for sharing but I doubt this will work.
@randy7425
@randy7425 4 жыл бұрын
do you have to use JavaScript for your test or can you use other languages?
@vdespa
@vdespa 4 жыл бұрын
Great question. With Postman you can only use JavaScript.
@randy7425
@randy7425 4 жыл бұрын
@@vdespa Are there other API testing tools/platforms that you know of that do not use JavaScript? I myself, am use to using python for automation tests, and would rather not have to learn a new language...thoughts?
@vdespa
@vdespa 4 жыл бұрын
@@randy7425 have you tried using pytest?
@randy7425
@randy7425 4 жыл бұрын
@@vdespa I have not. I can't find any documentation that says Postman can use pytest
@vdespa
@vdespa 4 жыл бұрын
If you don't want to learn JavaScript, forget about Postman. You need to use another tool. Writing API tests in Postman is rather easy. You can learn really fast.
@Yashwanthprasad
@Yashwanthprasad 4 жыл бұрын
How check whether data is pushing to database using postman...?
@vdespa
@vdespa 4 жыл бұрын
I think this will help kzfaq.info/get/bejne/Z5NpZMxolZuXc6c.html
@joylanjainckmesina4834
@joylanjainckmesina4834 3 жыл бұрын
I tried it on my end but I used "Host" instead. pm.test("HOST is httpbin.org", function () { var jsonData = pm.response.json(); pm.expect(jsonData.headers.Host).to.eql('httpbin.org'); });
@vdespa
@vdespa 3 жыл бұрын
Looks good.
@Zahira85Zen
@Zahira85Zen 4 жыл бұрын
and What if the object inside your json file is having any dots? for example let's suppose your file is having "is.Good" instead of "isGood"? I saw postman is giving me an error
@vdespa
@vdespa 4 жыл бұрын
Try something like someObject['is.Good'] Does this help?
@Zahira85Zen
@Zahira85Zen 4 жыл бұрын
Valentin Despa yes!!!
@ardit9988
@ardit9988 2 жыл бұрын
😃
@aartirathee6390
@aartirathee6390 3 жыл бұрын
Solution:- pm.test("your test name", function(){ pm.expect(jsonData.headers.Cache-Control).to.eql('no-cache');})
@vdespa
@vdespa 3 жыл бұрын
Are you sure that this won't cause any errors, Aarti?
@MK-ms6um
@MK-ms6um 3 жыл бұрын
I am appreciating all the effort but it is impossible to listen your videos. The champ noises you make before every sentence are unbearable to listen to.
@vdespa
@vdespa 3 жыл бұрын
I am sorry about that. I am working to remove them in the latest videos.
@MK-ms6um
@MK-ms6um 3 жыл бұрын
@@vdespa It is extra work and effort that you will make only for us! Thank you for that!
@vdespa
@vdespa 3 жыл бұрын
I am happy to help 😊 unfortunately existing KZfaq videos can't be 'repaired'. Stay tuned as I am pushing more content.
How write API Tests with Postman in 3 easy steps (PART 2/3)
15:59
Valentin Despa
Рет қаралды 29 М.
Learn JavaScript for Postman API testing - Full Course for Beginners
1:28:39
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 24 МЛН
Happy 4th of July 😂
00:12
Pink Shirt Girl
Рет қаралды 60 МЛН
Postman Beginner's Course - API Testing
2:09:38
freeCodeCamp.org
Рет қаралды 2,3 МЛН
Data-driven testing using Postman
13:37
Valentin Despa
Рет қаралды 58 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,1 МЛН
How to Use Postman for Beginners ? | Super Easy !
21:13
Saumya Nayak
Рет қаралды 40 М.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
thoughtbot
Рет қаралды 872 М.
Learn Postman in 15 Minutes
15:20
TomDoesTech
Рет қаралды 28 М.
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 24 МЛН