• July 22, 2024
  • iBirds Software Services Pvt. Ltd.
  • 0

by :Avijit Baidya 

 2

Introduction: Postman is an essential tool for developers, enabling them to streamline API development and testing processes. With Postman, you can easily build, test, and document API requests, while taking advantage of its extensive features to enhance collaboration and automation within your development projects.

Step 1: How to install the PostmanThere are two ways to run Postman:

  1. As a standard app or
  2. Directly in the browser
  • The standalone app is available for Windows, macOS, and Linux.
  • Postman Web: Works on any browser, use Desktop Agent if needed.
  • Do not use the Google Chrome extension as this is deprecated and no longer updated.

Step 2: How to create our own workspaces.

Why we need a workspace.

In Postman, “workspaces” refer to collaborative environments that allow teams to work  together on API-related projects. Workspaces are shared areas where team members can create, organize, and manage API collections, environments, documentation, and other assets. They provide a structured and collaborative space for multiple team members to collaborate on API development and testing, ensuring that everyone has access to the same resources and can work on projects efficiently. Workspaces are particularly useful for organizations that want to centralize their API-related work and promote collaboration among team members.

  • Steps Creation of Workspace:-
hxHZ5JvsVOTkeBif0uVxqM8prApkFxaqAnOwhUosWoirtapZrc0WFIjbr
MkTTTXptOQFyGl67DAhavmhmjAXca3WfqmZERHmcxR9fOkGB4ZQCitHPpsMvtri VaqGObAkOVbwY3sua No w661CdmGkQaEizoePOhirNBiDLYEOk e2L CawUrVYISlNeKzzCiZXv84zPHhbwDQ

Step 3: API request with Postman

  • The API we are using uses the HTTPS protocol.
  • HTTP stands for Secure Hypertext Transfer Protocol.
  • HTTP ensures that the connection is encrypted.
  • All APIs should use HTTPS.
  • From our point of view, HTTP and HTTPS are the same.
  1. The HTTP request message will contain:
  • URL (address)
  • Request method (GET, POST, PUT, PATCH, DELETE)
  • Headers (User-Agent: Postman)
  • Body
L1L JQK8o98tyJBFBMRSQdj0C6loHzKdYJLuqBjLkjM3CkCMTCF9YY5i6MLxfjBytpVTWUgNm83oFOsoFTP0cOyBiiBpRc0jg dke5ryOfZ
  • In the URL we are using HTTPS protocol. This HTTPS stands for Hypertext Transfer

Protocol Secure.

Step 4: How to add Postman collection and Variable.

  • How to save the request?
RNfjcIkvqKytLrsq7x8J gEFlpPrSZhQUh H16e0FEyKqyeIEOqycm5KWCH6nxnuMCezkDXKXHmY8XlUyE1HITy qYR0540nMG UmbpEKYdi6hJ06ZEGdRwa6a4EM5IVVgCICYIsNrOP1yLU14OdRQ=w489 h331
  • You can save requests so that you can reuse them later on.
  • All requests need to be added to a Postman collection.
  • We are storing the base address of the API in a collection variable called baseUrl
8Z51BXjcTCdjZ4gizAoFl lT8WfdE5vomFwrpnB UslS MZL9Yer9D kFxuUmRjfoSgLw4ILoh 9y 2 dB6H96atgI99X kIkmonNETVDhUqduElLqzomALGybrgrTbYZyCLr0s0 acOmnNOAewqSQ
oobxpR27c70sR9Lt6A4YyCf7 OsRgbMpUGSh QuKsRgKWjwMjfyB5EE8tF1lBC8VeTuaJr9fB0eSwkgCywPBdymdBykolgP7Tzm5jv9OQ3LMWiSnni5JFTJOY1 4RgfqyZsZDuxE39hj4WqsWvm3RQ=w495 h212
  • Our saved baseUrl will be displayed as {{baseUrl}} in the address bar.
NaaUGdX27kWmcN1oAAewufoI7Uab9AUndCIRnCk7yqvOE4MnGivvYpOFdvHWZRsKP0cR8RZfl48T8WuZDwqKouuli0vhTXijjW1288lQVpo1YjCnZ
  • How to set variables manually?
kay4W4GbUliWym4DJP7MI8tKF5NYchDEH3h46TvDRITJ8mtgVQah0hL3ndFP M7C8rS50y5ynaE0nzypVOqQDopp0V3Rp7Hwl2tv9CGzZnL xpnDTqh8tFuLVQ c6DQO7Ep6ouYvrOOqf2Kug1rOZg

Step 5: How to use Query Parameters in Postman

What are Query parameters?

Query parameters in Postman are key-value pairs that you can include in the URL when making an API request. These parameters are used to filter, sort, or modify the data you retrieve from the API. Query parameters are typically added to the end of the URL after a question mark (?), and multiple parameters are separated by ampersand (&)

  •  example of a URL with query parameters in Postman:
N4XFr8Tjo Lpzi8 eRVonSzqH6 y0VnEYqNxLFCYivPcqnadv4SS1We804kH5bLDU1uq0 emhz n3IASz9kSQeuWul0ahbMuiHNEWlEV5tor7LBWoAY
  • The format is key=value

Step 6: How to use Path Variables in Postman

What are Path Variables in Postman? Path variables in Postman are dynamic values within the URL path of an API request that allow you to send variable data as part of the URL. They are typically used to retrieve specific resources or perform actions on those resources by including them directly in the URL path

  •  Here’s an example of a declaration of a path variable.
sgxNbm0l8AXyxuV5Q96UfqJYoEEpKopC6Ers3bo RafcQBC34TBrestdH8MEjInHixxbH6H9sbGa JikIRLLzVS1cMtXmr0wrEPUlTpH6LNLr6mzqkzdqKB4LkBDyLSsd4AypQhpivfZnQAIHgwlag

Step 7: Why we are using Postman and where we can’t use Postman.

  • Postman is mainly used for communicating with API.
  • Limitation:
    • User Interaction
    • Performance Testing
    • Security Testing.

Step 8: How to write test class inside Postman.pMxOeV 3 HIzHL85 NSy9 uF97XtHT8VbofIRd25YPaY9 T9QEgD8vRHVVUkzuwKjhre1Z ztddwN ThJESTX OKmbILgtG9Ug84I1MHk IJhbTEX8ivQd3hkpi9PKdHZphSCvdHybE8e78n4P1qeg=w543 h331

Step 9: How to see response data in the Console in JS format

OfwRS7q4eg2kyXyT 2D8IFTty1HXmO7cj8an5ktiYksA5ralg3VmO 5Nhaa1UYKfF7xho0t7Xl dc7oDkZwnIPWQ2c1ObbqmZffrArXVbraD1DaTnk9lI0vxg5acHlVWTVk

Step 10: How to set global Variable in Postman.

   Why do we need a global variable?

  • In Postman, global variables are needed to store and share data across multiple requests or scripts in a collection or project, ensuring consistency, reusability, and easier maintenance of shared values, such as API endpoints, authentication tokens, or dynamic data, for efficient and organized API testing and development.
  • How to set: –
  • Step 1
443EWTLOK9ivfptp Jlj5w17bXEWLa5bcsyPWQbhqoZC8v Lm63J4t1 9KzwTPsOWK0DRS2JagHWRI7k9skK RMdvzXxir sQ nR8Voatl8F7 eDOQbf9T2sPI7NU0Uz4T57pXRQbYY0zN 50WYiog
  • Step 2
RQ1jUnnR dnZjaJM14QcyGf2esLJQgj8ZQORk0DZNemfBM5VpAhuMBD2DoOOROdNs2JbjJ89iuCGkL7wElbfxF15nkBZcGDuw8CZflhcq63uXeWmt4ONYb8VF89wfc7wufsKJ fcI1BxW QYhkP87A

Step 11: How to create a Collection in Postman and how to run all
methods at a time.

I fhSq8rmjES89P y7LQeo2qUBWFqwodvcpiov5N7Q1me6zVelrXfGVrk an1gEPiJ9wNVGhB70b9CyjvnIMNXTQ4HWeQ6zDIDdQmYwfoA OPjvtijWIG7Dig6vPRbuAL44sUTp31 LQejZy1XMpyQ=w542 h264

Output:

  • It will show full collection results at a time
g ZSqEchCFjRvWA3lQXhAyPQMNPodg48WXbdOAB5ofDUCl8yxv4sg9 3aUh70zbaNndj4AtwbPwL3c3Q0i8QhQuqPbfeVofYMmDQEfF3ejHZ0EEPkSladWzgDBIFhAT4R5B96BrELSr Y o10g6EsQ

Step 12: Monitors in Postman.

Postman Monitors are a feature in Postman that automates the testing and monitoring of APIs. They allow you to schedule and run collections of API requests at specified intervals, providing automated testing, performance assessment, and notifications for your APIs, which is particularly valuable in a continuous integration and delivery (CI/CD) environment.

rIAPHySWBJheEuVZTMovs0TzBEngNlfyWdoFhQC grLE IO2bPaXrlLU iYr8BhQOE5Pu M7f6f3iKY4bMW8IciuT2WQ bT4EWFCpj7gX8i 59uPAY 8nTmg4ciIyeT7SuSjK5Vh 6 to4KbOX9bag=w480 h189

Thank You

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.