API Testing using POSTMAN - Advance Test Cases

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 72

  • @Eddie-gb3bn
    @Eddie-gb3bn 6 лет назад

    Good video, however, I think it's very important to get your tests to fail before assuming the positive test is enough.

    • @ItsTechMode
      @ItsTechMode  6 лет назад +1

      We have been using it heavily in our company. It was just to explain a basic happy flow

  • @orangeagent2099
    @orangeagent2099 7 лет назад +1

    This was without a doubt one of the best video's I've seen on Postman... Subbing!

  • @bharad_p
    @bharad_p 8 лет назад

    Really grateful for the uploads,as not many tutorials are available on Postman Tests !! Crisp and clear.

    • @ItsTechMode
      @ItsTechMode  8 лет назад

      +Bharadwaj Pendyala Thanks for the feedback, stay tuned for some more advance concepts

  • @anushagatti1241
    @anushagatti1241 4 года назад

    Thanks for info which you have shared and very well explained

  • @shubhammsaini
    @shubhammsaini 6 лет назад

    Very Nicely and with simplicity explained the use of Tests tab of postman, Liked it!! --Keep Rocking!

  • @udhayasan
    @udhayasan 7 лет назад

    Your awesome. I’m a beginner and was struggling to write test condition. Your video clarified all my doubts. Great job bro.

    • @vijaykumar-ut1ze
      @vijaykumar-ut1ze 4 года назад

      Do you have any test plan template for integration testing

  • @TenkasiSubramanian
    @TenkasiSubramanian 6 лет назад

    FYI
    In 5:30 you told that to use jsonData.value. This works only for the response have only one Value. If response have multiple values with tag "Value" then you need to define like jsonData[0].value. Then only it will deeply pass the result.

  • @iyerakhila123
    @iyerakhila123 4 года назад

    Thank you for making API testing look so simple. In real world testing is this what we do when we say API testing or is there more to it, I mean advanced ways of testing the API?

  • @shrutilembhe8954
    @shrutilembhe8954 8 лет назад

    Hi Pramod...This is really very helpful.
    But I want to know more about the writing the test cases as I am doing API testing first time.
    Please share more videos on advanced test case design.

    • @ItsTechMode
      @ItsTechMode  8 лет назад +2

      +Shruti Lembhe You can get the latest post on my blog too, scrolltest.com

    • @maheshjoshi9537
      @maheshjoshi9537 8 лет назад

      ItsTechMode hi I want to learn how write tests in javascript..in postman. what are the things I need to learn as tester if I want write javascript tests in postman. please make video for example tests which can tests data integrity as well functionality of the api. thanks waiting for your reply.

  • @sv-ww7kr
    @sv-ww7kr 4 года назад

    Hi,
    All your videos are very helpful..
    Can we compare the collection response with CSV data file?
    I want to compare string from response with CSV data e.g.
    this is my response
    { "testId": 11,
    "testCode": "BBHYMUNI",
    "testName": "API test postman user",
    }
    {
    } ........
    I have CSV file with testId,testCode and testName
    How I can compare the response for multiple testname?
    I am able to compare testCode with following SNIPPET but testName is not working with same code
    var jsonData = pm.response.json();
    pm.test("Your test name", function () {
    pm.expect(jsonData[data.index].testCode).to.eql(data.testCode);
    })
    So please suggest how can I compare string

  • @TenkasiSubramanian
    @TenkasiSubramanian 6 лет назад

    Is there any way to validate x-total-count header value through code snippet? Which snippet should we use for header validations?

    • @ItsTechMode
      @ItsTechMode  6 лет назад

      Export request to nodejs.org code and check in code that will work for sure

    • @TenkasiSubramanian
      @TenkasiSubramanian 6 лет назад

      Oops I'm using my postman in Client PC. So I don't have access to install anything.

    • @TenkasiSubramanian
      @TenkasiSubramanian 6 лет назад

      Hi I have found another way to validate x-total-count header value. But that is not in Snippet. Anyway thanks for you. Below is the code I used to validate x-total-count header value and it was passed for me.
      tests["x-total-count header present with value-->" + postman.getResponseHeader("x-total-count")] = postman.getResponseHeader("x-total-count");

    • @TenkasiSubramanian
      @TenkasiSubramanian 6 лет назад

      Hey You already explained it in 2:17. Open your header tab. I guess you can view x-total-count value as 1 for the response you shown in video.

  • @LearnWithNeeraj777
    @LearnWithNeeraj777 5 лет назад

    Could you please take any web application and show some real time test cases or scenarios...also can you plz tell if this tutorial we can explain in interviews

  • @AravindanM93
    @AravindanM93 7 лет назад

    👏 good explanation for beginners

  • @shrutisaraf8393
    @shrutisaraf8393 7 лет назад

    Hi Pramod...This is really very helpful.
    But I want to know more about the writing the test cases as I am doing API testing first time.
    i want to learn how to write test cases .

    • @ItsTechMode
      @ItsTechMode  7 лет назад

      Check out my other tutorials , I hope that are helpful :)

  • @shahzaibshk3001
    @shahzaibshk3001 5 лет назад

    can we import these test cases in word or excel file?

  • @GeektheGladiator
    @GeektheGladiator 7 лет назад

    At the run time which environment it will pick. can we make the environment dynamic at run time?

    • @ItsTechMode
      @ItsTechMode  7 лет назад

      +Saurabh Mishra You can use newman command and pass the env.json at runtime depending upon your condition.

  • @TenkasiSubramanian
    @TenkasiSubramanian 6 лет назад

    I am getting error message jsonData is undefined and my snippet is different from the one you show.
    Snippet:
    var schema = {
    "items": {
    "type": "boolean"
    }
    };
    var data1 = [true, false];
    var data2 = [true, 123];
    pm.test('Schema is valid', function() {
    pm.expect(tv4.validate(data1, schema)).to.be.true;
    pm.expect(tv4.validate(data2, schema)).to.be.true;
    });

    • @ItsTechMode
      @ItsTechMode  6 лет назад +1

      Heck your code again, probably missing some variable

    • @TenkasiSubramanian
      @TenkasiSubramanian 6 лет назад

      No. Still same thing happening. When I do the same response you use same error message displayed. Which postman version you are using?

  • @serapioclan
    @serapioclan 7 лет назад

    Very informative video!! Thanks!!

  • @GeektheGladiator
    @GeektheGladiator 7 лет назад

    I am unable to connect MS SQL database with script in free version of POSTMAN. please suggest

  • @parveensultana8392
    @parveensultana8392 6 лет назад

    Hello, I am new to api testing and I tried test cases. I am getting this format when I click on 'Status Code is 200' from the snippet - pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
    });
    But you were getting completely different code snippet. Can you please help me on this how you got yours.

    • @ItsTechMode
      @ItsTechMode  6 лет назад

      Syntax is little changes but the logic is same. pm object is global and you can use the new and old one both

    • @parveensultana8392
      @parveensultana8392 6 лет назад

      Thanks. How can I access response body. Response : { "id" : 44.
      How can i check if 44 is there in response body?

    • @ItsTechMode
      @ItsTechMode  6 лет назад

      pm.test("Your test name", function () {
      var jsonData = pm.response.json();
      pm.expect(jsonData.id).to.eql(44);
      });

    • @parveensultana8392
      @parveensultana8392 6 лет назад

      Response code: 200
      ResponseMessage: ok
      Response:
      [{
      Id :44,
      Name:abc
      Nooflicense:4
      }]
      From this how can i get 44. How to validate the response?
      Thanks

  • @GeektheGladiator
    @GeektheGladiator 7 лет назад

    any idea about POST or PUT. how do we pass the parameter at run time? put more lite on code snippet

    • @ItsTechMode
      @ItsTechMode  7 лет назад

      +Saurabh Mishra You can pass the parameter in run time using environment or global variables check - g option in newman documentation.

    • @GeektheGladiator
      @GeektheGladiator 7 лет назад

      But how can we use code snippet there on postman? as we see there on soapUI the descriptive programming

    • @ItsTechMode
      @ItsTechMode  7 лет назад

      Email me - pramoddutta@live.com - Lets discuss it further :)

  • @prasadpujari3642
    @prasadpujari3642 6 лет назад +1

    Hi ,When I using tiny schema valdation then getting error -ReferenceError: jsonData is not defined

    • @ItsTechMode
      @ItsTechMode  6 лет назад

      Make sure this is present - var jsonData = pm.response.json();

  • @vigneshnagaraj7137
    @vigneshnagaraj7137 5 лет назад

    How to solve Internal server error

  • @biswajitguha6844
    @biswajitguha6844 7 лет назад

    Hi Pramod, thanks for uploading this tutorial. This was very helpful to me.
    Quick question...
    In the portion where you explained how to test the value of a particular key in the response body.
    tests["User ID should be "] = jsonData.userId === 1;
    For such a test, say, if we have a lot of values to be validated. Then it'll be difficult to compare with a hard-coded value.
    So my question is, is it possible for me to do this comparison from some file (csv, txt etc) where I can store the values and provide the path to the file? Something like,
    tests["User ID should be "] = jsonData.userId === .;
    Appreciate your help.

    • @ItsTechMode
      @ItsTechMode  7 лет назад +1

      +Biswajit Guha Hi I haven't tried it but I think if you have some sort Csv or text or json, try to require('data.csv') should work, let me try and get back to you.

    • @biswajitguha6844
      @biswajitguha6844 7 лет назад

      Thanks buddy. I actually tried with a csv file last night. It works for a single fragment of api data. Like this... Save the test as a collection and then execute it through Runner. Create a csv data file which has first row defined as the keys and subsequent rows as data. Provide the path of the file in the Collection Runner. Postman provides an object called 'data' which we can used to parse the file. So the statement would look like...
      tests["User ID should be "] = jsonData.userId === data.userID;

    • @biswajitguha6844
      @biswajitguha6844 7 лет назад

      Things get really messy when we have to use arrays. Let's say your user data is defined as an array of users.
      {
      "users": [
      {
      "userId": 1,
      "id": 1,
      "title": "xyz"
      },
      {
      "userId": 2,
      "id": 2,
      "title": "pqr"
      }
      ]
      }
      And the csv file has data as...
      userID,ID,Title
      1,1,xyz
      2,2,pqr
      The collection runner is just reading one row from the csv in each iteration. Therefore, the test passes for userId = 1, but fails for userId = 2, since the Runner has just parsed first row in the first iteration.
      tests["User ID should be "] = jsonData.users[0].userId === data.userID;
      Whereas, I need it to pick up both rows in a single iteration. Something like,
      tests["User ID should be "] = jsonData.users[0].userId === data[0].userID;
      tests["User ID should be "] = jsonData.users[1].userId === data[1].userID;
      But this approach doesn't work. 'data' does not take arrays.

    • @ItsTechMode
      @ItsTechMode  7 лет назад

      +Biswajit Guha Great

    • @biswajitguha6844
      @biswajitguha6844 7 лет назад

      I was actually hoping you'd have some solution to the 'data' object as array problem. :)
      Any idea how can I make the data object work as an array, or rather achieve parsing multiple rows from the datafile in a single iteration?

  • @nsv7305
    @nsv7305 7 лет назад

    simply superb.

  • @TenkasiSubramanian
    @TenkasiSubramanian 6 лет назад

    How to sync postman and alm?

    • @ItsTechMode
      @ItsTechMode  6 лет назад +1

      Haven't explore this dude sorry

    • @TenkasiSubramanian
      @TenkasiSubramanian 6 лет назад

      How to convert test run output xl or csv workbooks?

  • @irynaprokopenko6438
    @irynaprokopenko6438 8 лет назад

    hi. do you have lessons about newman? cli companion for postman

    • @ItsTechMode
      @ItsTechMode  8 лет назад +1

      Hi, Iryna . Check the playlist for API Testing - ruclips.net/p/PLr9tzW4-PrTatNwNb64xNIYq3Bd6OgRTy . I have tutorials on newman also. You can also check my website scrolltest.com

    • @ItsTechMode
      @ItsTechMode  8 лет назад +1

      How about this ?
      ruclips.net/video/ky3H8RQwz68/видео.html

    • @irynaprokopenko6438
      @irynaprokopenko6438 8 лет назад

      yes!!! wow, it what I need :) thanks.

  • @nandikondamalla
    @nandikondamalla 6 лет назад

    Good one.

  • @HieuTrandng
    @HieuTrandng 7 лет назад

    How to open console in windown 10 ?

    • @ItsTechMode
      @ItsTechMode  7 лет назад

      www.lifewire.com/how-to-open-command-prompt-2618089

  • @Sagarsrao
    @Sagarsrao 7 лет назад

    Just Awesome

  • @letme4u
    @letme4u 7 лет назад

    very nice !!!

  • @MaheshJoshi_wellington
    @MaheshJoshi_wellington 8 лет назад

    please make next videos please

    • @ItsTechMode
      @ItsTechMode  8 лет назад +1

      Sure , Let me know which all topic you would like to see.

    • @MaheshJoshi_wellington
      @MaheshJoshi_wellington 8 лет назад

      Hi , I mean whole series of videos which talk about all the functions of postman how to test get requests with all other parameters. Thanks Mahesh

    • @chitrasharma9195
      @chitrasharma9195 6 лет назад

      Hi, Can you please share how to test request using multiple data set ( not by using data file but by using code in pre scripts)