What Is API 1700933836
What Is API 1700933836
What is REST?
What is API Testing?
Japneet Sachdeva
What is API?
So it means you can carry data from backend and populate it to your front-end.
Japneet Sachdeva
Difference in webservice and api?
Web services require a network. While APIs can be on- or offline, web services
must use a network.
REST - is architectural design pattern which is used to design API. It makes API to
follow 6 main principles:-
1) Uniform interface
2) Statelessness
3) Layered system
4) Cacheability
5) Code on demand (Optional)
6) Client Server
Japneet Sachdeva
How API testing works?
Example - Searching for a product on Amazon - then the product searched by user
- A list of products will be showcased. So how is it done?
This is where business logic works! It helps compute data based on user actions.
So to perform this there are many ways like WebSockets, Polling, TCP connections
(API).
Japneet Sachdeva
Why API testing is required?
● API contracts are designed for this process - which helps how data is stored
(like JSON, XML, Form-Data etc.). Using these API contracts we can start
building our assertions/tests to make sure data displayed and stored is
working correctly.
● We as testers don't require UI to be finished so that we can start testing. We
just need Backend setup or sometimes we don't even require backend setup
as well because once we have API contracts.
● Once the environment is setup by backend dev team then we just need to hit
our requests on there servers and Boom we are ready to test. This form of
testing we can call as unit-testing.
Japneet Sachdeva
API basic architecture
Japneet Sachdeva
Basic REST API methods used in API testing
● GET - Helps to retrieve data from source (server). Not necessarily require a
request body. After request completes response is received.
● PUT - Helps to update data in the source (server). Requires Request body and
provides response once request completed.
● POST - Helps to create data in the source (server). Requires Request body and
provides response once request completed. POST request is parent of all the
request types so it can be used instead of GET, PUT, DELETE etc.
● DELETE - Helps to permanently remove data from source (server). It can work
with & without request body. Response is received once request completed.
Japneet Sachdeva
API terminologies in sync with database testing
Japneet Sachdeva
Practice API Testing using below website
Use Postman tool to practice basic GET, PUT, POST and DELETE requests.
Japneet Sachdeva