SlideShare a Scribd company logo
What is API?
API stands for the Application Programming Interface, They are basically a collection of functions and
procedures which allows us to communicate two application or library.
For example, It like a connector as seen in the picture. All data connects to our organization through API.
In one line, API is its an interface between different software programs or service.
Simple Examples is,
Suppose you go to a restaurant.
API is the messenger that takes your order(waiter) and tells the system(kitchen) what to do (to prepare food)
and in return gives back the response you asked for (waiter returns with the ordered food).
Source - Quora. https://www.quora.com/What-is-an-API
Type of APIs :-
What is API Testing?
When we talk about API Testing,
API testing is testing that APIs and its integration with the services.
It is one of the most challenging type of testing, If we miss the certain cases in API Testing that can cause a
very big problem in production after full integration and it will hard to debug in production environment..
In this definite guide,
We are basically discussing about the REST API Testing.Where we need to test the REST APIs for the
validation, error codes and load testing.
What is REST API?
As REST is an acronym for REpresentational State Transfer, statelessness is key. An API can be REST if it
follows the below constraints.
The REST architectural style describes six constraints. These constraints, put on the architecture, were initially
communicated by Roy Fielding in his doctoral dissertation and defines the basis of RESTful-style.
1. Uniform Interface
2. Stateless
3. Cacheable
4. Client-Server
5. Layered System
6. Code on Demand
Uniform Interface
The uniform interface constraint defines the interface between clients and servers.
In other terms,
First constraint of the REST API states that the Client and server has to communicate and agree to certain
rules based on resources(they should communicate with same resource like json, xml, html , txt) and with
proper encoding like UTF-8 extra.
Another point they should communicate with the Self-descriptive Messages e.g Use the same MIME types.
Stateless
APIs in REST are stateless and Client and server doesn’t worry about the state of the request or response..
Cacheable
According to the World Wide Web, clients can cache responses. Responses should therefore, implicitly or
explicitly, define themselves as cacheable. Its upto server when they want the cache to expired etc.
Client-Server
Client and Server are two different entity, It means that servers and clients may also be replaced and
developed independently, as long as the interface is not altered.
Layered System.
It means that the between client and server there can be any number of layered systems it does not matter.
Code on Demand
Server can store the Code or logic to themselves and transfer it whenever needed rather client side logic.
If any API fulfill all the constraints then we can it REST API.
Difference between REST API vs SOAP API.
We have already discussed REST API , Lets now Learn what is SOAP API.
SOAP (Simple Object Access Protocol) is a messaging protocol that allows programs that run on disparate
operating systems or services like frontend or backend to communicate using Hypertext Transfer Protocol
(HTTP) and its Extensible Markup Language (XML).
SOAP uses WSDL is an XML format for describing network services as a set of endpoints operating on
messages containing either document-oriented or procedure-oriented information.
Enough of background lets come to topic…
What to Test in API Testing?
● Validate the keys with the Min. and Max range of APIs (e.g maximum and minimum length)
● Have a Testcase to do XML,JSON Schema validation.
● Keys verification. If we have JSON, XML apis we should verify it's that all the keys are coming.
● Verify that how the APIs error codes handled.
Lets understand why API Testing is important…
Why you should perform API Testing?
● Many of the services that we use every day rely on hundreds of different interconnected APIs, if any
one of them fails then the service will not work.
● Right now, Internet uses millions of APIs and they should be tested thoroughly.
● Developers make mistake and they create buggy APIs..
● Validation of APIs is very important which are going live to production.
Above image shows the architecture of an application and notice that API Testing is important part..
Now…
Lets learn one more concept HTTP Methods
HTTP - Fundamentals
HTTP is an application layer protocol designed within the framework of the Internet protocol suite.
There is Client which perform a request resource which can be HTMLPage, file extra from Server and server
perform the response to the client back using the same protocol known as HTTP.
HTTP is a stateless protocol. In other words, the current request does not know what has been done in the
previous requests.
What is an Cookies?
Cookies are usually small text files, given ID tags that are stored on your computer's browser directory or
program data subfolders.
GET /spec.html HTTP/1.1
Host: www.example.org
Cookie: theme=light; sessionToken=abc123
Record the user's browsing activity.
Which pages were visited in the past.
Contain the name of the domain & Lifetime.
Tool : EditThisCookie - http://bit.ly/1oe1o08
What is Authentication and its types lets understand it...
What is Authentication?
Authentication is a process of presenting your credentials like username, password or another secret key to
the system and the system to validate your credentials or you. In the API terms Authentication is used to
protect the content over web mean only a valid user with valid credentials can access that API endpoint.
These credentials tell the system about who you are. Which enables the system to ensures and confirms a
user’s identity. Here system can be anything, it can be a computer, phone, bank or any physical office
premises.
Basic authentication - String is encoded with Base64.
curl --header "Authorization: Basic am9objpzZWNyZXQ=" my-website.com
Digest Authentication - Authentication is performed by transmitting the password in an ENCRYPTED
form.(With Some Salt etc)
OAuth- Authentication protocol that allows you to approve one application interacting with another on your
behalf without giving away your password.
E.g OAuth 1, 2.
More authentication are discussed here -
https://scrolltest.com/2018/11/22/how-to-handle-authentications-with-postman/
In Client as Browser and Server as DB with the service running in PHP.
We can create an HTTP request from browser by typing a URL.
Just for more information, URL can be broken down into the further chunks like protocol, host , post and query
params. More discussion is out of scope for URL
Lets Understand what all HTTP methods are present
HTTP Methods explained.
HTTP GET Method Explained -
.
HTTP POST Method Explained -
HTTP PUT Method Explained -
HTTP PATCH Method Explained -
HTTP DELETE & OPTIONS Method Explained -
HTTP HEAD/TRACE Method Explained -
Now we have a HTTP Methods knowledge lets understand what are Cookie and authentication.
How to Test an API ( API Testing)?
Before that take a look into the example api that can available freely.
https://api.chucknorris.io/jokes/random
Here Keys are
cateroy, icon_url, id, url and value and they have corresponding values as String or number.
API Testing can be done manually or using a Tools. It is always recommend to certain tools.
Lets learn API Testing using our favorite tools..
Below is the list of API testing tools, You can learn or use whichever tool you feel is great for you, I encourage
you to start with Postman it's an awesome API Testing tool which provide lots of feature like command line,
CI/CD and monitoring of APIs with testcase support.
API Testing tools
● Runscope.com
● Postman CI/CD
● Katalon using CI/CD
● SoapUI CI/CD
● Rest Assured CI/CD
API Testing using POSTMAN
What is Postman?
First of all, let’s understand what is Postman.
It is an API Testing tool used by developers and Testers to perform API Testing with lots of different features
like Global variables, mock request, Environment and monitoring of APIs.
You can learn more about a postman in my full Video lecture series here. Download and install it.
P.S – This article assumes that you have some experience with Postman. If not please go through my previous
tutorials.
Its available in the MacOS, Windows and Linux as Native app.
Download Postman - https://www.getpostman.com
Major features of postman

More Related Content

What's hot

API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
Pricilla Bilavendran
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
Mohammed Fazuluddin
 
API Testing following the Test Pyramid
API Testing following the Test PyramidAPI Testing following the Test Pyramid
API Testing following the Test Pyramid
Elias Nogueira
 
Testing RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured frameworkTesting RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured framework
Micha Kops
 
Weaponizing Your DevOps Pipeline
Weaponizing Your DevOps PipelineWeaponizing Your DevOps Pipeline
Weaponizing Your DevOps Pipeline
Puma Security, LLC
 
Automação e virtualização de serviços
Automação e virtualização de serviçosAutomação e virtualização de serviços
Automação e virtualização de serviços
Elias Nogueira
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
ParrotBAD
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
Andrey Oleynik
 
Api testing
Api testingApi testing
Api testing
Keshav Kashyap
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
n|u - The Open Security Community
 
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Edureka!
 
Testing RESTful web services with REST Assured
Testing RESTful web services with REST AssuredTesting RESTful web services with REST Assured
Testing RESTful web services with REST Assured
Bas Dijkstra
 
testng
testngtestng
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
Alessandro Giorgetti
 
Postman & API Testing by Amber Race
Postman & API Testing by Amber RacePostman & API Testing by Amber Race
Postman & API Testing by Amber Race
Postman
 
OWASP API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World
42Crunch
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
Shailendra Chauhan
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
TEST Huddle
 
Security testing
Security testingSecurity testing
Security testing
Rihab Chebbah
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
Bruno Pedro
 

What's hot (20)

API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API SecurityRest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
 
API Testing following the Test Pyramid
API Testing following the Test PyramidAPI Testing following the Test Pyramid
API Testing following the Test Pyramid
 
Testing RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured frameworkTesting RESTful Webservices using the REST-assured framework
Testing RESTful Webservices using the REST-assured framework
 
Weaponizing Your DevOps Pipeline
Weaponizing Your DevOps PipelineWeaponizing Your DevOps Pipeline
Weaponizing Your DevOps Pipeline
 
Automação e virtualização de serviços
Automação e virtualização de serviçosAutomação e virtualização de serviços
Automação e virtualização de serviços
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Api testing
Api testingApi testing
Api testing
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
 
Testing RESTful web services with REST Assured
Testing RESTful web services with REST AssuredTesting RESTful web services with REST Assured
Testing RESTful web services with REST Assured
 
testng
testngtestng
testng
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
 
Postman & API Testing by Amber Race
Postman & API Testing by Amber RacePostman & API Testing by Amber Race
Postman & API Testing by Amber Race
 
OWASP API Security Top 10 - API World
OWASP API Security Top 10 - API WorldOWASP API Security Top 10 - API World
OWASP API Security Top 10 - API World
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
Security testing
Security testingSecurity testing
Security testing
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 

Similar to Api Testing.pdf

Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
NamanVerma88
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API Testing
pCloudy
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testing
b4usolution .
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
Aparna Sharma
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
rajnishjha29
 
Top 20 API Testing Interview Questions.pdf
Top 20 API Testing Interview Questions.pdfTop 20 API Testing Interview Questions.pdf
Top 20 API Testing Interview Questions.pdf
AnanthReddy38
 
The ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.ioThe ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.io
Blendr.io
 
How To Get Started With API Testing In Your Organization.pdf
How To Get Started With API Testing In Your Organization.pdfHow To Get Started With API Testing In Your Organization.pdf
How To Get Started With API Testing In Your Organization.pdf
pcloudy2
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best Practices
Jordan Open Source Association
 
API Testing Basics.pptx
API Testing Basics.pptxAPI Testing Basics.pptx
API Testing Basics.pptx
VikasGupta92111
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
EngmohammedAlzared
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
RahulCR31
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
RahulCR31
 
Web Service
Web ServiceWeb Service
Web Service
Ashwani kumar
 
Api_testing.pdf
Api_testing.pdfApi_testing.pdf
Api_testing.pdf
RameshN849679
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
Katy Slemon
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
Er. Prashant Veer Singh
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
Yos Riady
 
Crafting APIs
Crafting APIsCrafting APIs
Crafting APIs
Tatiana Al-Chueyr
 
Webservicex.pdf
Webservicex.pdfWebservicex.pdf
Webservicex.pdf
ssuser751c981
 

Similar to Api Testing.pdf (20)

Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API Testing
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testing
 
Best practices and advantages of REST APIs
Best practices and advantages of REST APIsBest practices and advantages of REST APIs
Best practices and advantages of REST APIs
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 
Top 20 API Testing Interview Questions.pdf
Top 20 API Testing Interview Questions.pdfTop 20 API Testing Interview Questions.pdf
Top 20 API Testing Interview Questions.pdf
 
The ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.ioThe ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.io
 
How To Get Started With API Testing In Your Organization.pdf
How To Get Started With API Testing In Your Organization.pdfHow To Get Started With API Testing In Your Organization.pdf
How To Get Started With API Testing In Your Organization.pdf
 
JOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best PracticesJOSA TechTalks - RESTful API Concepts and Best Practices
JOSA TechTalks - RESTful API Concepts and Best Practices
 
API Testing Basics.pptx
API Testing Basics.pptxAPI Testing Basics.pptx
API Testing Basics.pptx
 
Session 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdfSession 8 Android Web Services - Part 1.pdf
Session 8 Android Web Services - Part 1.pdf
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
 
Web Service
Web ServiceWeb Service
Web Service
 
Api_testing.pdf
Api_testing.pdfApi_testing.pdf
Api_testing.pdf
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
 
Crafting APIs
Crafting APIsCrafting APIs
Crafting APIs
 
Webservicex.pdf
Webservicex.pdfWebservicex.pdf
Webservicex.pdf
 

More from JitendraYadav351971

computer Graphic.pdf
computer Graphic.pdfcomputer Graphic.pdf
computer Graphic.pdf
JitendraYadav351971
 
core java notes.pdf
core java notes.pdfcore java notes.pdf
core java notes.pdf
JitendraYadav351971
 
Interview Questions.pdf
Interview Questions.pdfInterview Questions.pdf
Interview Questions.pdf
JitendraYadav351971
 
System Design.pdf
System Design.pdfSystem Design.pdf
System Design.pdf
JitendraYadav351971
 
OOPS Interview Questions.pdf
OOPS Interview Questions.pdfOOPS Interview Questions.pdf
OOPS Interview Questions.pdf
JitendraYadav351971
 
OOPs TOP Question for interview.pdf
OOPs TOP Question for interview.pdfOOPs TOP Question for interview.pdf
OOPs TOP Question for interview.pdf
JitendraYadav351971
 
Boost Frontend.pdf
Boost Frontend.pdfBoost Frontend.pdf
Boost Frontend.pdf
JitendraYadav351971
 
Thermodynamics.pdf
Thermodynamics.pdfThermodynamics.pdf
Thermodynamics.pdf
JitendraYadav351971
 
C programming.pdf
C programming.pdfC programming.pdf
C programming.pdf
JitendraYadav351971
 
Basics of HTML.pdf
Basics of HTML.pdfBasics of HTML.pdf
Basics of HTML.pdf
JitendraYadav351971
 

More from JitendraYadav351971 (20)

computer Graphic.pdf
computer Graphic.pdfcomputer Graphic.pdf
computer Graphic.pdf
 
sql notes.pdf
sql notes.pdfsql notes.pdf
sql notes.pdf
 
CSS notes.pdf
CSS notes.pdfCSS notes.pdf
CSS notes.pdf
 
core java notes.pdf
core java notes.pdfcore java notes.pdf
core java notes.pdf
 
ptyhon notes.pdf
ptyhon notes.pdfptyhon notes.pdf
ptyhon notes.pdf
 
SQL question.pdf
SQL question.pdfSQL question.pdf
SQL question.pdf
 
DSA notes.pdf
DSA notes.pdfDSA notes.pdf
DSA notes.pdf
 
Mongo DB.pdf
Mongo DB.pdfMongo DB.pdf
Mongo DB.pdf
 
c language.pdf
c language.pdfc language.pdf
c language.pdf
 
Interview Questions.pdf
Interview Questions.pdfInterview Questions.pdf
Interview Questions.pdf
 
System Design.pdf
System Design.pdfSystem Design.pdf
System Design.pdf
 
OOPS Interview Questions.pdf
OOPS Interview Questions.pdfOOPS Interview Questions.pdf
OOPS Interview Questions.pdf
 
HTML.pdf
HTML.pdfHTML.pdf
HTML.pdf
 
OOPs TOP Question for interview.pdf
OOPs TOP Question for interview.pdfOOPs TOP Question for interview.pdf
OOPs TOP Question for interview.pdf
 
Boost Frontend.pdf
Boost Frontend.pdfBoost Frontend.pdf
Boost Frontend.pdf
 
java notes.pdf
java notes.pdfjava notes.pdf
java notes.pdf
 
Thermodynamics.pdf
Thermodynamics.pdfThermodynamics.pdf
Thermodynamics.pdf
 
C programming.pdf
C programming.pdfC programming.pdf
C programming.pdf
 
Basics of HTML.pdf
Basics of HTML.pdfBasics of HTML.pdf
Basics of HTML.pdf
 
Metaverse.pdf
Metaverse.pdfMetaverse.pdf
Metaverse.pdf
 

Recently uploaded

The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 

Recently uploaded (20)

The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 

Api Testing.pdf

  • 1. What is API? API stands for the Application Programming Interface, They are basically a collection of functions and procedures which allows us to communicate two application or library. For example, It like a connector as seen in the picture. All data connects to our organization through API. In one line, API is its an interface between different software programs or service.
  • 2. Simple Examples is, Suppose you go to a restaurant. API is the messenger that takes your order(waiter) and tells the system(kitchen) what to do (to prepare food) and in return gives back the response you asked for (waiter returns with the ordered food). Source - Quora. https://www.quora.com/What-is-an-API Type of APIs :-
  • 3. What is API Testing? When we talk about API Testing, API testing is testing that APIs and its integration with the services. It is one of the most challenging type of testing, If we miss the certain cases in API Testing that can cause a very big problem in production after full integration and it will hard to debug in production environment.. In this definite guide, We are basically discussing about the REST API Testing.Where we need to test the REST APIs for the validation, error codes and load testing. What is REST API? As REST is an acronym for REpresentational State Transfer, statelessness is key. An API can be REST if it follows the below constraints. The REST architectural style describes six constraints. These constraints, put on the architecture, were initially communicated by Roy Fielding in his doctoral dissertation and defines the basis of RESTful-style. 1. Uniform Interface 2. Stateless 3. Cacheable 4. Client-Server 5. Layered System 6. Code on Demand Uniform Interface The uniform interface constraint defines the interface between clients and servers. In other terms, First constraint of the REST API states that the Client and server has to communicate and agree to certain rules based on resources(they should communicate with same resource like json, xml, html , txt) and with proper encoding like UTF-8 extra.
  • 4. Another point they should communicate with the Self-descriptive Messages e.g Use the same MIME types. Stateless APIs in REST are stateless and Client and server doesn’t worry about the state of the request or response.. Cacheable According to the World Wide Web, clients can cache responses. Responses should therefore, implicitly or explicitly, define themselves as cacheable. Its upto server when they want the cache to expired etc. Client-Server Client and Server are two different entity, It means that servers and clients may also be replaced and developed independently, as long as the interface is not altered. Layered System. It means that the between client and server there can be any number of layered systems it does not matter. Code on Demand Server can store the Code or logic to themselves and transfer it whenever needed rather client side logic. If any API fulfill all the constraints then we can it REST API.
  • 5. Difference between REST API vs SOAP API. We have already discussed REST API , Lets now Learn what is SOAP API. SOAP (Simple Object Access Protocol) is a messaging protocol that allows programs that run on disparate operating systems or services like frontend or backend to communicate using Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML). SOAP uses WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. Enough of background lets come to topic… What to Test in API Testing? ● Validate the keys with the Min. and Max range of APIs (e.g maximum and minimum length) ● Have a Testcase to do XML,JSON Schema validation. ● Keys verification. If we have JSON, XML apis we should verify it's that all the keys are coming. ● Verify that how the APIs error codes handled. Lets understand why API Testing is important…
  • 6. Why you should perform API Testing? ● Many of the services that we use every day rely on hundreds of different interconnected APIs, if any one of them fails then the service will not work. ● Right now, Internet uses millions of APIs and they should be tested thoroughly. ● Developers make mistake and they create buggy APIs.. ● Validation of APIs is very important which are going live to production. Above image shows the architecture of an application and notice that API Testing is important part.. Now… Lets learn one more concept HTTP Methods HTTP - Fundamentals HTTP is an application layer protocol designed within the framework of the Internet protocol suite.
  • 7. There is Client which perform a request resource which can be HTMLPage, file extra from Server and server perform the response to the client back using the same protocol known as HTTP. HTTP is a stateless protocol. In other words, the current request does not know what has been done in the previous requests. What is an Cookies? Cookies are usually small text files, given ID tags that are stored on your computer's browser directory or program data subfolders. GET /spec.html HTTP/1.1 Host: www.example.org Cookie: theme=light; sessionToken=abc123 Record the user's browsing activity. Which pages were visited in the past. Contain the name of the domain & Lifetime. Tool : EditThisCookie - http://bit.ly/1oe1o08 What is Authentication and its types lets understand it... What is Authentication? Authentication is a process of presenting your credentials like username, password or another secret key to the system and the system to validate your credentials or you. In the API terms Authentication is used to protect the content over web mean only a valid user with valid credentials can access that API endpoint. These credentials tell the system about who you are. Which enables the system to ensures and confirms a user’s identity. Here system can be anything, it can be a computer, phone, bank or any physical office premises. Basic authentication - String is encoded with Base64. curl --header "Authorization: Basic am9objpzZWNyZXQ=" my-website.com
  • 8. Digest Authentication - Authentication is performed by transmitting the password in an ENCRYPTED form.(With Some Salt etc) OAuth- Authentication protocol that allows you to approve one application interacting with another on your behalf without giving away your password. E.g OAuth 1, 2. More authentication are discussed here - https://scrolltest.com/2018/11/22/how-to-handle-authentications-with-postman/ In Client as Browser and Server as DB with the service running in PHP. We can create an HTTP request from browser by typing a URL. Just for more information, URL can be broken down into the further chunks like protocol, host , post and query params. More discussion is out of scope for URL Lets Understand what all HTTP methods are present
  • 9. HTTP Methods explained. HTTP GET Method Explained - .
  • 10. HTTP POST Method Explained - HTTP PUT Method Explained -
  • 11. HTTP PATCH Method Explained - HTTP DELETE & OPTIONS Method Explained -
  • 12. HTTP HEAD/TRACE Method Explained - Now we have a HTTP Methods knowledge lets understand what are Cookie and authentication. How to Test an API ( API Testing)? Before that take a look into the example api that can available freely. https://api.chucknorris.io/jokes/random Here Keys are cateroy, icon_url, id, url and value and they have corresponding values as String or number. API Testing can be done manually or using a Tools. It is always recommend to certain tools. Lets learn API Testing using our favorite tools..
  • 13. Below is the list of API testing tools, You can learn or use whichever tool you feel is great for you, I encourage you to start with Postman it's an awesome API Testing tool which provide lots of feature like command line, CI/CD and monitoring of APIs with testcase support. API Testing tools ● Runscope.com ● Postman CI/CD ● Katalon using CI/CD ● SoapUI CI/CD ● Rest Assured CI/CD API Testing using POSTMAN What is Postman? First of all, let’s understand what is Postman. It is an API Testing tool used by developers and Testers to perform API Testing with lots of different features like Global variables, mock request, Environment and monitoring of APIs. You can learn more about a postman in my full Video lecture series here. Download and install it. P.S – This article assumes that you have some experience with Postman. If not please go through my previous tutorials. Its available in the MacOS, Windows and Linux as Native app. Download Postman - https://www.getpostman.com
  • 14. Major features of postman