Skip to content

How To Use Postman Web Version

API Testing Blog

Getting Started with Postman Web Version

Postman is a powerful tool for API testing, and its web version offers a convenient way to get started without any local installations. Here’s a step-by-step guide on how to navigate and use Postman in the browser:

1. Accessing the Postman Web Version

  1. Visit the Website: Open your web browser and navigate to https://www.postman.com/.
  2. Sign Up or Sign In: If you don’t have an account, click “Sign Up” and create a free account. Otherwise, click “Sign In” to access your existing workspace.

2. Creating Your First Request

  1. Open the Postman App: Once signed in, you’ll be redirected to the Postman web app.
  2. Start with a New Request: Click the “New” button in the top-left corner and choose “Request.”
  3. Choose a Method: Select the HTTP method you want to use from the dropdown (e.g., GET, POST, PUT, DELETE).
  4. Enter the Request URL: In the “Enter request URL” field, type the URL of the API endpoint you want to test.

Example:

https://reqres.in/api/users

3. Sending Your First Request

  1. Send the Request: Click the “Send” button to execute the request.
  2. View the Response: The response from the server will be displayed in the “Response” pane, including the status code, headers, and body.

Example (GET Request):

  • Request Method: GET
  • Request URL: https://reqres.in/api/users
  • Response Status Code: 200 OK
  • Response Body: (JSON data containing user information)

4. Adding Headers and Body

  1. Headers Tab: Click the “Headers” tab to add or modify request headers.
  2. Body Tab: Click the “Body” tab to send data with the request (e.g., JSON, XML, form data).

Example (POST Request with JSON body):

  • Request Method: POST
  • Request URL: https://reqres.in/api/users
  • Headers:
    • Content-Type: application/json
  • Body:
    {
    "name": "John Doe",
    "job": "Software Engineer"
    }

5. Working with Collections

  1. Create a Collection: A collection helps organize your requests and related documentation. Click the “New” button and choose “Collection.” Give your collection a descriptive name.
  2. Add Requests: Drag and drop requests into your collection. You can also create new requests directly within the collection.
  3. Share Collections: Share your collections with collaborators for team collaboration and efficient API testing.

Example Collection:

  • Name: User API
  • Requests:
    • Get Users
    • Create User
    • Update User
    • Delete User

6. Utilizing Variables

  1. Define Variables: Variables allow you to reuse values across multiple requests within a collection. Click the “Variables” tab in your collection to define variables.
  2. Use Variables in Requests: Use the {{variable_name}} syntax to insert variables into your request URLs, headers, or body.

Example:

  • Variable: baseUrl with value https://reqres.in/api
  • Request URL: {{baseUrl}}/users

7. Using Tests

  1. Add Tests: Go to the “Tests” tab and write JavaScript code to run assertions against the API response.
  2. Assertions: Use Postman’s built-in test functions to check for expected values, status codes, or headers.

Example (Test for Status Code 200):

pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});

8. Automating with Scripts

  1. Pre-request Scripts: Write code in the “Pre-request Script” section to execute actions before sending the request (e.g., generate dynamic data).
  2. Tests Scripts: Use the “Tests” section to perform actions after receiving the response (e.g., log data, update variables).

Example (Pre-request Script to generate a random number):

let randomNumber = Math.floor(Math.random() * 100) + 1;
pm.variables.set("randomNumber", randomNumber);

9. Collaboration and Sharing

  1. Team Workspaces: Organize your work by sharing collections and requests with team members in a dedicated workspace.
  2. Sharing with External Users: Grant access to specific collections or requests for developers or stakeholders outside your team.

Postman is a powerful tool that empowers you to test and document APIs efficiently. By utilizing its web version, you can easily access and leverage its features without any local installations.

API Testing Blog