Back to Course
Postman

Postman Keywords

Common Postman Scripting Keywords

  • pm.test("name", function(){...}) — defines a named test with a pass/fail assertion.
  • pm.response.to.have.status(200) — asserts the response status code.
  • pm.expect(value).to.eql(expected) — general-purpose assertion comparing actual vs expected.
  • pm.response.json() — parses the response body as JSON for further checks.
  • pm.environment.set("key", value) / pm.environment.get("key") — set or read environment variables.
  • pm.globals.set("key", value) — sets a global variable accessible across environments.

Why These Matter

These keywords are the building blocks for turning manual Postman requests into automated, self-verifying tests.

Ready to master real-world software testing?

Learn manual and automation testing hands-on with mentor-led sessions.

Explore Course