#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Writing Tests with Postman Scripts & Assertions

Where Tests Live

Tests are written in the Tests tab of a request and run automatically after the response is received. Postman also provides a snippets panel with ready-made test templates.

Basic Assertion Structure

A test is wrapped in pm.test("description", function () { ... }), with assertions inside using pm.expect() to check values against expected results.

Common Assertions

AssertionChecks
Status codeResponse returned the expected status
Response timeRequest completed within a limit
Header presenceExpected header exists
Body contentResponse contains expected values

Viewing Test Results

After sending a request, the Test Results tab shows a pass/fail summary for every assertion, making it easy to spot failures at a glance.

Basic assertions are a great start - next, let's dig into custom tests for more detailed response validation.

Ready to master Postman API Testing Course?

Join Uncodemy's hands-on training and build real-world API testing skills with expert mentors.

Explore Course