API Testing using POSTMAN - Advance Test Cases

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 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  5 років тому +1

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

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

  • @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 7 років тому

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

    • @ItsTechMode
      @ItsTechMode  7 років тому

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

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

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

  • @LearnWithNeeraj777
    @LearnWithNeeraj777 4 роки тому

    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

  • @shahzaibshk3001
    @shahzaibshk3001 5 років тому

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

  • @shrutilembhe8954
    @shrutilembhe8954 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.
    Please share more videos on advanced test case design.

    • @ItsTechMode
      @ItsTechMode  7 років тому +2

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

    • @maheshjoshi9537
      @maheshjoshi9537 7 років тому

      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

  • @serapioclan
    @serapioclan 7 років тому

    Very informative video!! Thanks!!

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

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

  • @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 років тому

    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.

  • @GeektheGladiator
    @GeektheGladiator 7 років тому

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

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

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

  • @irynaprokopenko6438
    @irynaprokopenko6438 7 років тому

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

    • @ItsTechMode
      @ItsTechMode  7 років тому +1

      Hi, Iryna . Check the playlist for API Testing - ua-cam.com/play/PLr9tzW4-PrTatNwNb64xNIYq3Bd6OgRTy.html . I have tutorials on newman also. You can also check my website scrolltest.com

    • @ItsTechMode
      @ItsTechMode  7 років тому +1

      How about this ?
      ua-cam.com/video/ky3H8RQwz68/v-deo.html

    • @irynaprokopenko6438
      @irynaprokopenko6438 7 років тому

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

  • @nsv7305
    @nsv7305 7 років тому

    simply superb.

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

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

  • @nandikondamalla
    @nandikondamalla 6 років тому

    Good one.

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

  • @vigneshnagaraj7137
    @vigneshnagaraj7137 5 років тому

    How to solve Internal server error

  • @Sagarsrao
    @Sagarsrao 7 років тому

    Just Awesome

  • @HieuTrandng
    @HieuTrandng 7 років тому

    How to open console in windown 10 ?

    • @ItsTechMode
      @ItsTechMode  7 років тому

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

  • @letme4u
    @letme4u 7 років тому

    very nice !!!

  • @MaheshJoshi_wellington
    @MaheshJoshi_wellington 7 років тому

    please make next videos please

    • @ItsTechMode
      @ItsTechMode  7 років тому +1

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

    • @MaheshJoshi_wellington
      @MaheshJoshi_wellington 7 років тому

      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)