Posts

Showing posts with the label API

How would you approach API exploratory testing?

Image
 This question was asked during 30 days of API Testing in the Ministry of Testing. I have used  https://excalidraw.com/ to share my thoughts. Let me know your suggestions for improvement or comments!

API Testing

Image
In my previous blog, I explained what API is. I will delve deep into the importance of testing the API in this blog. While most testing focuses on the UI, which is crucial, it is equally important to test APIs from the initial stages of the software development. The purpose of API testing is to make sure the interface between two applications is working smoothly without any interruptions. Let me take an example to explain. Seetha tells her mother Latha, that she wants a new pair of shoes for her school. Because it is raining outside and they cannot go shopping directly, Latha decides to buy the shoes online using a mobile application to shop at the “ABC” store. In this example, Latha  is the  client  who sends the request by searching for specific shoe requirements. The  mobile application  is the  API  that gets the request from the client and waits for the response from the server and again it sends back the response to Latha The  “ABC” store ...

A software middleman (API)

Image
We depend on someone/something in every part of our life.  We always need a middleman to solve our purposes. How is the middleman involved in our daily life? We need toothbrushes to clean our teeth. We need a  grocery store to buy groceries. We need utensils/stove to cook our food. We need teeth to chew food. We need mobile phone/communication channels to connect with someone not next to us. We need a  mode of transportation to commute to work/travel. We need a  place to sleep. We need shelter to stay. We need banks for financial transactions. We need hospitals to access healthcare services and many more… In everyone’s life, we need something/someone to complete our needs. Similarly, every system/software requires a middleman to communicate with other systems or software. It generally refers to this software middleman as an Application Programming Interface (API). Do we really correlate our technical knowledge with our everyday life? If the answer is no, th...

Hypermedia REST API

Image
Hypermedia is nothing but in simple terms it has hyperlinks associated with the API endpoint. It helps the API to link to related resources associated with the endpoint. This reduces the coupling between the server and the client. A hypermedia-driven REST API, often called a HATEOAS (Hypermedia As The Engine of Application State) API, utilizes hypermedia to enable dynamic interactions between clients and servers. In a hypermedia-driven API, clients navigate the API by following hyperlinks embedded within the responses received from the server, rather than relying on predefined URLs or endpoint structures.  Let me take an e-commerce online store as an example to explain more. When I search for a resource namely a product, it associates with its own API endpoint, links to 'Add to Cart', 'Save for Later', 'Buy Now', and 'Similar Products'. These connected links are called  Hypermedia links. I do not need multiple endpoints to refer to other endpoints becaus...

Variety of Keys...

 The power of keys in the real world makes its own purpose. There are different types of keys to operate a lock. Why do we have different types of keys? Because it serves to open a lock made for a specific reason. The most commonly used locks are deadlocks for residential doors and external security, knob locks for internal doors in residences, padlocks for lockers, gates, and sheds, keycard systems for hotels and offices, smart/digital door locks for modern homes and offices, tubular locks for vending machines and ATMs, time locks for bank vaults and safety. When we come into the application, APIs provide connectivity between applications to exchange data and services. To make it secure, we use authentication and authorization.  Authentication allows the user to access the application. Authorization 's main focus is to have the right people to have the right access to the right resources.  We have various authentication types to secure accessing the API in the software ...

Essential Checklist for HTTP Requests in API Testing

Image
  This is an attempt to remind you what needs to be checked while sending and retrieving data from an HTTP request in API testing. Method - Ensure the appropriate method (GET, POST, PUT, DELETE, etc.) has been selected to send the request using any tools like Postman, SOAPUI, or Swagger. Host - The host plays a crucial role in hitting the exact server the user wants for the operation. Version of API - The version should be known before hitting the request. It helps to process the data in the deserved endpoint. Path - When the path is provided in the way where exact data is to be stored or updated, it reaches the destination correctly. Endpoint - It is the destination point. Though the entire direction is correct, if the request does not have an accurate endpoint, it leads to retrieving inappropriate data and is time-consuming. Request Payload - Payload is the data provided to the server to process the request correctly. Request Headers - It is crucial for communication between the...

Cookie (Part II)

Image
The basic definition of Cookie is  here . Now, let us dive deep into this topic with everyday life. You have a house named "Happy Home" which is 1000 square feet in size and you have a main door key that is a number lock system. You know the PIN to open your house's main door and the PIN has to be changed periodically. Suppose, today is Nov 2, 2023, and the PIN has to be changed on 1st of Jan, 2024.  Now, you will have three different scenarios. 1) Each room has a separate PIN that includes the main door. Once you open the door, you can access only the living room, and the rest of the rooms are locked and cannot open because you don't know the PIN (to access). 2) The living room and the master bedroom have the same PIN. Once you open the door, you can access the living room and your master bedroom (locked earlier) using the same PIN.  3) The main door has a number lock. The rest of the room doors are already open and have no lock system. In this case, if you open the ...

Cookie, Session and Token

Browsing is significant in everyday life and unavoidable. Do you know how your data is stored and how you are getting the responses based on your HTTP request through the web browser? A session is created temporarily when the user wants to use a particular website. It refers to the user's visiting time and has other session-related details. The cookie and session are combined together to work for the user's better experience. The web browser sends the session ID with the cookie to the server to check the user is valid when they try to access another related page and the session ID is unique and hard to guess. The session information will be stored in the server's database only when the cookie has the session ID details. In the bank example, when the user logs in to their account, the session is created with ID and the session ends when the user logs out or is inactive for some time. A token is totally a different concept in which the server creates a token ID when the user ...

What is a Socket?

Image
Socket acts as an endpoint to communicate two computers with one another in a computer network. When two applications running on two different machines want to send data, a socket is used to transfer by connecting ports on the machines through their IP addresses. It is executed by the transport layer such as a TCP/IP model or OSI model using protocols like TCP, and UDP. The client sends a request to the server by establishing a connection through the server port and its IP address. Socket address is the combination of socket and IP address. For example, the IP address is 10.10.10.10 and the port number is 80, so the socket address is 10.10.10.10:80. There are three types of sockets available: a) Stream socket (Connection-oriented): Error-free, reliable, and bidirectional. It uses Transmission Control Protocol (TCP) to deliver sequential packets by establishing a connection. Applications used here are Telnet/SSH, HTTP, HTTPS, etc. b) Datagram socket (Connectionless): This type of soc...