How write API Tests with Postman in 3 easy steps

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024

ความคิดเห็น • 113

  • @thomasfranz4826
    @thomasfranz4826 6 ปีที่แล้ว +3

    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!

  • @geryvanegas1
    @geryvanegas1 5 ปีที่แล้ว +6

    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 3 ปีที่แล้ว +1

      @@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'.

  • @MaheshJoshi_wellington
    @MaheshJoshi_wellington 6 ปีที่แล้ว +8

    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 ..:)

  • @williamstings
    @williamstings 3 ปีที่แล้ว +3

    After going through countless stackoverflow threads this video taught me what i needed in a few minutes. Awesome content!

  • @renemandiangu1890
    @renemandiangu1890 6 ปีที่แล้ว +2

    Valentin, you are the best. You explain things the simplest way. Keep up the good work. Thanks.

  • @Gabe9408
    @Gabe9408 6 ปีที่แล้ว +1

    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 !!

  • @joshuakincheloe
    @joshuakincheloe 6 ปีที่แล้ว +1

    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.
      th-cam.com/video/nAeHa1sMkp0/w-d-xo.html

  • @sameernaqvi1751
    @sameernaqvi1751 6 ปีที่แล้ว +1

    The best video on API testing on youtube, your explanation is superb..

  • @vinayam4080
    @vinayam4080 3 ปีที่แล้ว +3

    Very Good tutorial... Thank you for your efforts...

    • @vdespa
      @vdespa  3 ปีที่แล้ว

      I am glad it helped. Thanks for letting me know.

  • @mariiakit4830
    @mariiakit4830 5 ปีที่แล้ว +1

    Valentin, thanks to you I've created the test to verify that boolean true returns!! I don't even know javascript!

  • @celiadallel2749
    @celiadallel2749 2 ปีที่แล้ว +1

    Thank you so much for all! You are THE BEST

    • @vdespa
      @vdespa  2 ปีที่แล้ว

      Thanks, Celia!

  • @mikeroberts6203
    @mikeroberts6203 5 ปีที่แล้ว +6

    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.
      th-cam.com/video/nAeHa1sMkp0/w-d-xo.html

    • @ardit9988
      @ardit9988 2 ปีที่แล้ว

      🇬🇧🇬🇧🇽🇰🇽🇰🦋🦋💫

  • @shikhaawasthi5333
    @shikhaawasthi5333 4 ปีที่แล้ว +1

    Really helpful videos. You covered basics in crisp and simple way. Thanks.

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      You are welcome. Thanks for letting me know

  • @JennyAChannel
    @JennyAChannel 2 ปีที่แล้ว +1

    What a great explanation!!

    • @vdespa
      @vdespa  2 ปีที่แล้ว

      Glad you think so! You are welcome. Thank you for leaving a comment.

  • @nadeem2sparkle2005
    @nadeem2sparkle2005 6 ปีที่แล้ว

    Appreciate your patience and eagerness to share knowledge, well done.

  • @yuwenpixon
    @yuwenpixon 4 ปีที่แล้ว +1

    very clear tutorial. Thanks man!

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      You're welcome!

  • @isratnilu2791
    @isratnilu2791 2 ปีที่แล้ว +1

    Thanks for this video.

    • @vdespa
      @vdespa  2 ปีที่แล้ว +1

      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

  • @Arqu07
    @Arqu07 5 ปีที่แล้ว +9

    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

  • @Mohamed-uf5jh
    @Mohamed-uf5jh 5 ปีที่แล้ว

    Great Job Valentin ,I am discovering Postman , it not just an test api ,It's more wow

  • @codelaravel
    @codelaravel ปีที่แล้ว +1

    Great work 👍

    • @vdespa
      @vdespa  ปีที่แล้ว

      Thank you! Cheers!

  • @eliasshikhalshabab805
    @eliasshikhalshabab805 5 ปีที่แล้ว

    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.
      th-cam.com/video/nAeHa1sMkp0/w-d-xo.html

  • @Richa801
    @Richa801 6 ปีที่แล้ว +1

    Thank you for the awesome video.. making learning easy

  • @prashantkatti
    @prashantkatti 5 ปีที่แล้ว

    Very well taught in the video. I am active member and follower of your course now.

  • @lizalinnayak1029
    @lizalinnayak1029 4 ปีที่แล้ว +1

    Thank you so much ... Really helped me a lot...

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      I am glad to hear that, thank you!

  • @Julie_withoutRomeo
    @Julie_withoutRomeo ปีที่แล้ว

    Thanks for your videos Valentin, enjoying it from Nigeria . But can one push their API from postman to GitHub??

  • @ON-zd3vf
    @ON-zd3vf 5 ปีที่แล้ว

    This was excellent. Thanks!

  • @anshikaagarwal9493
    @anshikaagarwal9493 2 ปีที่แล้ว +1

    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?

  • @harmeets375
    @harmeets375 4 ปีที่แล้ว +1

    Great Learning...

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      Thank you very much!

  • @mayurshankar3181
    @mayurshankar3181 4 ปีที่แล้ว +1

    wowowowowowowowoowow Valentinnnnnnnnnn Genuius Man!

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      Thanks!

  • @isamorita8647
    @isamorita8647 5 ปีที่แล้ว

    Thank u!! great tutorial

  • @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

  • @NehaKumari-hn4uk
    @NehaKumari-hn4uk 2 ปีที่แล้ว

    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

  • @janetgardner1105
    @janetgardner1105 6 ปีที่แล้ว +1

    Great Job

  • @rodybothe3329
    @rodybothe3329 6 ปีที่แล้ว +1

    Good explanation :)

  • @vdespa
    @vdespa  4 ปีที่แล้ว +2

    Download the FREE Postman Quick Reference Guide
    👉 www.subscribepage.com/postman

  • @mamdohlotfy3459
    @mamdohlotfy3459 4 ปีที่แล้ว +1

    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.

  • @abdelrahmanatef2325
    @abdelrahmanatef2325 5 ปีที่แล้ว

    Keep it up its great tutorial

  • @siddharthau489
    @siddharthau489 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

      You're welcome! You can't access the filesystem from scripts.

  • @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.

  • @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 ปีที่แล้ว +1

      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.

  • @zxcvmjg
    @zxcvmjg 5 ปีที่แล้ว

    Nice tutorial!!

  • @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.

  • @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 ปีที่แล้ว +1

      Will learn thank you for the reply:)

  • @bibilebaby
    @bibilebaby 4 ปีที่แล้ว

    The ending made me nervous,,,,Good explanation tho,thanks a lot

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      😂 thanks for watching. I am glad it was useful.

  • @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.

  • @emiliozelarayan2306
    @emiliozelarayan2306 2 ปีที่แล้ว

    Nice

    • @vdespa
      @vdespa  2 ปีที่แล้ว

      Great! Thank you.

  • @Yashwanthprasad
    @Yashwanthprasad 4 ปีที่แล้ว

    How check whether data is pushing to database using postman...?

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      I think this will help th-cam.com/video/1-91i7053Cs/w-d-xo.html

  • @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..!!

  • @LFF___
    @LFF___ 4 ปีที่แล้ว

    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  4 ปีที่แล้ว

      Thanks for sharing but I doubt this will work.

  • @RakeshBitling
    @RakeshBitling 4 ปีที่แล้ว

    Nice video link is paid..pls share free url ..loved your explanation

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      Place subscribe to the TH-cam channel for more free tutorials.

  • @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');
    });

  • @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?

  • @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 ปีที่แล้ว +1

      Try something like someObject['is.Good'] Does this help?

    • @Zahira85Zen
      @Zahira85Zen 4 ปีที่แล้ว +1

      Valentin Despa yes!!!

  • @nageshkp4768
    @nageshkp4768 4 ปีที่แล้ว

    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  4 ปีที่แล้ว +1

      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.

  • @marcussmith2006
    @marcussmith2006 6 ปีที่แล้ว

    @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 6 ปีที่แล้ว

      @@vdespa thanks Valentine - love your videos - as I've answer the competition correctly do i still win a copy of your course?

  • @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.

  • @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.

  • @aartirathee6390
    @aartirathee6390 4 ปีที่แล้ว

    Solution:- pm.test("your test name", function(){ pm.expect(jsonData.headers.Cache-Control).to.eql('no-cache');})

    • @vdespa
      @vdespa  4 ปีที่แล้ว

      Are you sure that this won't cause any errors, Aarti?

  • @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...

  • @ardit9988
    @ardit9988 2 ปีที่แล้ว

    😃

  • @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 ปีที่แล้ว +1

      @@vdespa It is extra work and effort that you will make only for us! Thank you for that!

    • @vdespa
      @vdespa  3 ปีที่แล้ว +1

      I am happy to help 😊 unfortunately existing TH-cam videos can't be 'repaired'. Stay tuned as I am pushing more content.