API Testing

  •  Introduction

What is an API?

Web testing we do front-end -selenium

API testing we perform on the backend side Postman and rest ratio

API - form manually we use Postman

and for automation, we use rest assured

Client:- is a computer hardware device or software that accesses a service made available by a server

From client side we are able to browse the data or requesting data

Server:- is a physical computer dedicated to run services to serve the needs of other computers

From server side it will fetch the data related to this keyword and sending the response

Client Server Architecture:

  1. 1 tier Architecture ( ex :When I saved my word doc in side a document folder) here the same machine work as client and server (client computer and File server)
  2. 2-tier Architecture (ex: in a bank, they have many client computers that access the same db server) Here this db runs in a different machine (Client tier and DB Server)
  3. 3-tier Architecture:- web applications followed 3-tier arc. ( in the 3-tier arc. we have 3 layers

1st layer is the Client tier - where the users request the data

[Presentation layer - user interface] - we use different scripting languages to develop the web application ex: HTML5. JavaScript and CSS

2nd layer is the Business Logic Tier or Application server or web application run - here they take the request from the client and send it to the DB tier or DB server, and then fetch the data from the DB and send it back to the client layer

[Application layer- business logic]-here we use Java, .Net, C#, Python, C++

3rd layer is the DB tier or server where the real data is stored.

[Data layer]-MySQL, Oracle, PostgreSQL, Mongo DB



  • Front end of the application - It is the presentation layer. It helps to send request to API layer using HTML, Javascript etc. it is normally a web application. Do Web testing to test web application.
  • Middle Layer (API Layer) - It consists with business logics. it takes the Request from the Client and Send the Request to the Server and get the Response from the Server and Send it to the Client. For that it uses C#, .Net, Java, etc. In this layer we do API Testing. 
  • Back End of the application - It consists with data and Send the correct data according to the Request. For test this layer we do Database testing.


Responsibilities of the API Layer:

  • Take the data from the front end and insert into backend.
  • Fetch data from the backend and display on the frontend.
API is a way of communication between Backend and Frontend.
In API Testing we send the API Request and then test the Respond to verify data.


Type of APIs
  1. SOAP (Simple Object Access Protocol) - Supports only XML Data
  2. REST (Representational State Transfer) - Support for XML, JSON, HTML, Text
REST API


REST API Methods
  1. GET - Receive information about an API resource
  2. POST  - Create an API resource
  3. PUT - Update an API resource
  4. DELETE - Delete an API resource
HTTP vs HTTPS

  • HTTPS is the secure, encrypted version of HTTP and is critical for protecting data and maintaining the integrity of web communication. Suitable for websites that don't handle sensitive information or user interactions (e.g., purely informational, static content).
  • HTTPS ensures security, privacy, and trustworthiness, making it the preferred choice for nearly all modern websites. Essential for any website that deals with sensitive information, including login forms, online payments, user data, and any type of personal or financial information.
Payload

It means Body in the HTTP Request and Response message. It is the data in Response and request. Data in the request called as Request Payload and  data in the response called as Response Payload.




Comments

Popular posts from this blog

How to log a defect/bug with a detailed description?

What are the different environments in a software development team