postman
what
- API Client
- develop,test.share,document APIs
COLLECTION
what
- collection is a group of api requests that can be stroed and saaved in logical arrangement
- forms the basis for advanced operations in POSTMAN
how
- run?
- analyse?
Veriables
- what
- element(data srouce) that can take different values
- why
- to reuse values at multiple places avoid repetition
- ot avoid re-work when value changes
- how to set and get veriables through scripting
- get:
pm.variables.get("url");
- set:
pm.variables.set("name","xtcacti");
Environment
Env is a set of key-value pairs
Script Snippets
- how to create quick scripts using Snippets
First Test
- what are test in postman?
- postman tests are javascript code that is executed after receiving the response
- create tests at REQUEST level~
- create tests at FOLDER level~
- create tests at COLLECTION level~
DEBUG
- debug
- open console
- clear logs
console.log()/info()/warn()/error()
- Develop - DevTools
run from Command Line
- install node.js
- install newman
- export collection and run from commandline
- newman is a command line collection runner for Postman
newman run exportname.json
newman run -h
run form Jenkins
- how to setup postman on Jenkins?
- hor to run postman on Jenkins?
WORKSPACES
- what is workspaces?
- an area where you can group, organize and manage collections
- create & manage workspaces
- share collections in workspaces
- remove collection form workspaces
DDT - Data Driven Testing
How to use csv and json data files
- how to get data from csv file?
- how to get data from json file?
- how to run data driven API Request?
- how to run data driven tests?
run a Collections Remotely
- How to get Collection URL?
- get collection url by Share-get public link
- How to run COllection remotely (from anywhere) using collection url?
- install newman and run with command
newman run https://www.getpostman.com/collections/04cb136837edf89cea19
How to run SOAP requests
- get SOAP request url or WSDL url add to request url
- set method as POST
- Set body as raw and set header text/xml
- Provide request data body
- chrome plugin - Wizdler
- Run and validata
How to get value from Reponse and refer in Request | REST
- fetch data or value form response of one API and refer in another API
- Add request in Postman
- Use env variables to parameterize the value to be referred
- Add scripts to fetch value from response of 1st API
- Update the fetch va;ue in env veriables
- Run and validate
ref:
API Authorization in Postman
- verify the identify
e.g. create repo on github by API which need login,otherwise will get response401Unauthorized
- create token on github and add token to Authorization Postman - Bearer Token