Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

## POSTMAN DOCUMENT ##

1)Status Code & Methods example


Status Code Description
200 OK / Successful.
201 Resource Created
4XX CLIENT ERROR
400 Bad Request > Bad input parameter given by user
401 Un Authorized > Client is not registered or sent invalid token
403 Forbidden > User is registered but not authorized for specific resource, which user is looking for
404 Resource Not Found > User is registered but resource which he’s looking for not found
408 Request Timeout > Server not received request with in specified time
5XX SERVER ERROR
500 Internal Server Error > Server’s are not working as expected, user’s request is valid but server not
working
503 Service Unavailable > Server is temporarily not working, Due to overload request issue.

2) Base Url

Complete Url = https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-


33.8670522,151.1957362&radius=1500&key=AIzaSyCzDn4ZSuqeBSC2ZUy-M_FnNkQXuseCwBQ

Base Url = https://maps.googleapis.com

3) Endpoint
Complete Url = https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-
33.8670522,151.1957362&radius=1500&key=AIzaSyCzDn4ZSuqeBSC2ZUy-M_FnNkQXuseCwBQ

[Comment]: Above given url is called Endpoint

4) Parameter > Path Parameter || Query Parameter

Complete Url = https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-


33.8670522,151.1957362&radius=1500&key=AIzaSyCzDn4ZSuqeBSC2ZUy-M_FnNkQXuseCwBQ

[Comment]: Any value which comes after “?” is query parameter, Three Query param used in this URL

1) location=-33.8670522,151.1957362&
2) radius=1500&
3) key=AIzaSyCzDn4ZSuqeBSC2ZUy-M_FnNkQXuseCwBQ
5) Difference Authentication and Authorization
[Authentication] is the process of verifying who a user is

[Authorization]: is the process of verifying what they have access to.

[401 Unauthorized]: Since user is not registered in an app, He/she is not authorized person to login

[403 Forbidden]: User is Registered, but user has not access to resource which user is looking for

9) [COOKIES] & [SESSION] Difference


1) Storage > [COOKIES] are only stored on the client-side machine, [SESSION] get stored on the client
as well as a server.

2) Expiration > [COOKIES] can also persist after client closes the browser or shuts down while
[SESSION] typically don’t last as long to conserve resources.

3) Security > [SESSION] is more secure than COOKIES. Because [SESSION] will destroy it's data
immediately and after closing the application. But COOKIE gets its data for a defined time, either the
application is opened or closed.
# [MAJOR DIFFERENCES BETWEEN COOKIES & SESSION]

[Session]

A session creates a file in a temporary directory on the server where registered session variables and
their values are stored. This data will be available to all pages on the site during that visit.

A session ends when the user closes the browser or after leaving the site, the server will terminate
the session after a predetermined period of time, commonly 30 minutes duration.

[Cookies]

Cookies are text files stored on the client computer and they are kept of use tracking purpose. Server
script sends a set of cookies to the browser. For example, name, age, or identification number etc.
The browser stores this information on a local machine for future use.

When next time browser sends any request to web server then it sends those cookies information to
the server and server uses that information to identify the user.

# Newman is command line collection runner for postman

Step1) check if node is installed on system or not

cmd

node -v

npm -v

Step 2) install node.js

check if node and npm are installed

Step 3) Install newman

npm install -g newman


Step 4) Export collection json file

Step 5) On cmd goto location of collection json file

Step 6) Run newman

newman run collecctionfilename.json (path of the file name where .json file is kept)

12) Newman Collection Runner: Running collection runner file using newman
Command to run json collection using newman
newman run <path-of-the-collection>(.json file)
newman run <"E:\Postman API Collections\COVID19-Tracker.postman_collection.json">

14) Postman Integration with Jenkins


Navigate to Jenkins.war file to run the same:

War file getting extracted


Jenkins is now fully up and running

In browser enter localhost: 8080


POST PUT PATCH
POST Method is used to Create PUT method is used to update PATCH method is used to
resources the resource update partial (only required
data) data
Used to create new resource Used to update existing Used to create existing
resource resource
201 Status code 204 Status code 204 Status code
JSON body created Whole Json body sent for Only required key from Json
Updation body is send for Updation

Path Param Query Param


Path Param is basically used to identify a Query Parameter is used to sort/filter those
specific resource or resources resources
GET /employee/{id} GET /employee? Start=1&size=10

API test actions


1) Verify correct HTTP status code
2) Verify response payload
3) Verify response headers.
4) Verify correct application state.
5) Verify basic performance sanity
Test scenario categories
Our test cases fall into the following general test scenario groups:

1) Basic positive tests (happy paths)


2) Extended positive testing with optional parameters
3) Negative testing with valid input
4) Negative testing with invalid input
5) Destructive testing
6) Security, authorization, and permission tests (which are out of the scope of this post)

You might also like