API Testing using POSTMAN – Advance Test Cases

Reading Time: 1 minute

In this tutorial, We are going to write some TESTCASES in the POSTMAN Chrome as a part of API Testing.

API Testing includes

1. JSON Schema Validation
2. Response Time Verification
3. Verification of the Keys defined in response by API
4. Values as Expected (Data driven Testing) in response

Learn about JSON Schema – http://jsonschema.net

 

Code  – 
URL –  https://jsonplaceholder.typicode.com/posts/1

Test Code  –

 

 

6 thoughts on “API Testing using POSTMAN – Advance Test Cases”

  1. Thanks for the post.
    I was trying to use json schema.net but it does not seem to be generating the Json schema.
    Please help.

    Thanks,
    Arvind

  2. Hello Promode,

    I am following your blog related to schema validation via postman but found that and trying to use in my own test
    Command on line#38 tests[“Valid schema”] = tv4.validate(jsonData, schema); will pass for all the time even if you make changes to schema.

    Please let me know if you have another way of validation schema.

  3. Hello,

    Nice Explanation. Im new to API testing, and I tried your examples.
    I tried writing test cases following your video, just small doubt .
    When I click on any snippet like – Response body:Contains String – I get this in the test case tab -pm.test(“Body matches string” , function () {
    pm.expect(pm.response.text()).to.include(“userId”);
    });

    And I have seen on your screen as – tests[“Content-Type is present”] = postman.getResponseHeader(“Content-Type”);

    Can you please explain me why I’m getting diferent . That would be helpful. Thanks

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Shares
Tweet
Share
Pin
Share
+1