Thursday, 4 July 2024

map online shopping status with REST API

 

Example Sequence of API Calls

  1. Browse products: GET /products
  2. View product details: GET /products/12345
  3. Add product to cart: POST /cart
  4. View cart: GET /cart
  5. Update cart: PUT /cart/67890
  6. Proceed to checkout: POST /checkout
  7. Make payment: POST /payment
  8. Order confirmation: GET /orders/abcdef
  9. Track order: GET /orders/abcdef/tracking
  10. View order history: GET /orders

Thursday, 13 June 2024

Run API Test with CSV file

 Using CSV files with Postman’s Collection Runner allows you to run a collection of requests with different sets of data. Here are the detailed instructions to use a CSV file and Postman to run the Collection Runner:

Step-by-Step Guide

1. Prepare the CSV File

Create a CSV file with the data you want to use in your requests. The first row should contain the variable names, and subsequent rows should contain the values. Here’s an example:



2. Set Up Postman Collection

  1. Open Postman and create a new collection or use an existing one.
  2. Add Requests to your collection that will use the data from the CSV file.

3. Add Variables in Requests

In your requests, use the variable names from the CSV file inside double curly braces. For example:

  • URL: https://api.example.com/users
  • Body (if it’s a POST request)


4. Run Collection with Collection Runner

  1. Open Postman and click on the Runner button at the top left (it looks like a stopwatch).

  2. Select the Collection you want to run from the left sidebar.

  3. Select the Environment (if any) you want to use.

  4. Select the Data File:

    • Click on the Choose Files button under Data.
    • Select your CSV file.
  5. Set the Iterations to the number of rows in your CSV file, minus the header row.

  6. Click the Start Run button.




Friday, 1 March 2024

Query Params

 How to include the query param in the request URL?

  • https://s-letru-sd/rest/cd/?name=test&version=1

Response headers

 CONTENT  TYPE

  • Specifies the MIME type of the data in the response body.

CONTENT LENGTH

  • Specifies the length of the response body in bytes.

CACHE-CONTROL

  • Specifies the caching behaviour of the response.

LOCATION

  • Specifies the URI of a resource that can be used to retrieve the requested resource.

SERVER

  • Specifies the name and version of the server software that generated the response.

ACCESS CONTROL ALLOW ORIGIN

  • Specifies which origins are allowed to access the resource.


Request Methods

 GET

  • Retrieve data from the server

POST

  • Send data to the resource to create a resource

DELETE

  • Delete the resource

PUT

  • Send data to the server to update a resource

PATCH

  • Send data to the server to update resources partially

Sunday, 28 January 2024

Explain API Test Automation Framework

REST ASSURED API FRAMEWORK 

Design Pattern 

  • Page Object Model

Languages

  •  Java

Tool

  • Rest Assured

Automation Framework

  • Cucumber

Other Dependencies

  •  Apache POI
  • JsonPath
  • JSON schema validator

Logging 

  • log4j

Reporting 

  • Report portal

CI/CD

  • Jenkins Pipeline

Cypress  API FRAMEWORK 

Language

  • Javascript

Tool

  • Cypress

Reporting

  •     Mocheaswesome



Thursday, 25 January 2024

Headers

 What are the header components used in your API test?

  • USER ID
  • STAFF ID
  • WORKING UNIT
  • DEVICE NAME
  • AUTHORIZATION - BASIC unique id

map online shopping status with REST API

  Example Sequence of API Calls Browse products : GET /products View product details : GET /products/12345 Add product to cart : POST /cart ...