The Postman Cheatsheet & Quick Reference Guide

tests
help
json
responseassertion

#1

Hey community,

I have created a document called Postman Quick Reference Guide, which is practically a collection of things I often stumble upon while using Postman and need a quick answer to.

This is still kind of work in progress, but inside you will find:

  • Cheatsheet with most important methods for writing scripts and tests
  • Simple solutions to common problems
    • Request creation
    • Assertions
    • Workflows
    • Newman

You can download this for FREE (no email / registration clickbait) by clicking the image below:

2018-02-15_19-46-39-1bb3dab1095a471c7ffdc51d3e796637

https://goo.gl/2hUCXd

I hope you find this useful!

PLEASE let me know what you think about the Postman Quick Reference Guide, if and how it helps you be more productive and efficient while using Postman.

If there is anything missing or if you have any suggestions on how to improve it, just let me know.


#2

Nice Job !!! Thank you very much !!!


#3

Awesome! Thank you for sharing this with the community @vdespa. I am tweeting this out from my account. :slight_smile:


#4

This is fantastic! Great work @vdespa


#5

Good stuff. Missing a couple of closing single quotes:

  • page 4
    pm.response.to.have.body(’{“success”=true});
    should be
    pm.response.to.have.body(’{“success”=true}’);

pm.expect(pm.response.text()).to.include('Order placed.);
should be pm.expect(pm.response.text()).to.include(‘Order placed.’);

pm.expect(jsonData.name).to.eql('John);
should be
pm.expect(jsonData.name).to.eql(‘John’);

If I find more typos, I’ll post here. Great stuff indeed. helps not having to wade through all the docs.


#6

Thanks for pointing them out. I will fix them with the next release.


#7

Such a useful reference!

Wanted to chime in on one bit. There are indeed super-local variables like var variableName = variableValue; that can be used within the script where it’s declared.

There’s also local variables with setters and getters available only via the pm.* API:

pm.variables.set("variableName", variableValue);

pm.variables.get("variableName"); // can also be used to get other variable types

These local variables can be used to save state within the same request (e.g. pre-request to test script) and also throughout the same collection run. That means that you can use a local variable to save state throughout a collection run without doing any teardown / clearing / unsetting at the end, and you don’t have to worry about polluting any namespaces.

The official Postman documentation about this is not very clear. We are working on this, as well as other stuff about variables in general.


#8

Yes you are right. I will update the guide to reflect that. It took me a while to understand what local variables are :smiley:


#9

I have done similar thing for a excellent IBM product , needless to say this is excellent work done by Valentin. Kudos Valentin.
Cheers
K.thulsi