B4USolution_API-Testing

API Testing
Group 10 – D14CQCPN01
Lecturer: Lê Thị Bích Hòa
Type of API Webservice
 -SOAP
 RESTFUL
What is SOAP?
 SOAP stands for Simple Object Access Protocol. It is a XML-based protocol for
accessing web services..
 SOAP is XML based protocol. It is platform independent and language
independent. By using SOAP, you will be able to interact with other programming
language applications.
What is REST?
 REST stands for REpresentational State Transfer.
 REST is an architectural style not a protocol.
The Difference Beetween SOAP and REST APIs
No. SOAP REST
1 SOAP is a protocol. REST is an architectural style.
2
SOAP stands for Simple Object Access Protocol.
REST stands for REpresentational State Transfer.
3 SOAP can't use REST because it is a protocol. REST can use SOAP web services because it is a concept and can use any
protocol like HTTP, SOAP
4 SOAP uses services interfaces to expose the business
logic
REST uses URI to expose business logic.
5 JAX-WS is the java API for SOAP web services. JAX-RS is the java API for RESTful web services.
6 SOAP defines standards to be strictly followed. REST does not define too much standards like SOAP.
7 SOAP requires more bandwidth and resource than
REST.
REST requires less bandwidth and resource than SOAP.
8 SOAP defines its own security. RESTful web services inherits security measures from the underlying
transport.
9 SOAP permits XML data format only. REST permits different data format such as Plain text, HTML, XML, JSON etc.
10 SOAP is less preferred than REST. REST more preferred than SOAP.
Viewing a Simple SOAP Example
 Example soap: <?xml version = “1.0” encoding =“UTF-8”?>
<id>01</id><name>team10</name>
 Example rest : {
id:”01”,name:
”team 10”
}
What is an API?
What is an API?
- An acronym for Application Programming Interface.
- It enables communication and data exchange between two
separate software systems.
What is an API?
What is API Testing?
- Entirely different from GUI Testing
- This testing won't concentrate on the look and feel of an
application.
- In Api Testing, you use software to send calls to the API, get
output, and note down the system's response.
What is API Testing?
What is API Testing?
Api Testing requires an application to interact with API. In order to test an API, you
will need to
+ Use Testing Tool to drive the API
+ Write your own code to test the API
Set-up of API Test environment
- Required to setup initial environment that invokes API with required set of
parameters and then finally examines the test result.
- This stage, GUI maybe not available.
- Setting up a testing environment for API testing seems a little complex.
- Database and server should be configured as per the application requirements.
- Once the installation is done, API Function should be called to check whether that API is
working.
Types of Output of an API
Output of API could be:
- Any type of data
- Status (say Pass or Fail)
- Call to another API function.
Example:
There is an API function which should add two integer numbers.
- The numbers have to be given as input
parameters.
- The output should be a summation of two integer
numbers.
- This output needs to be verified with expected
outcome.
- Calling needs to be done such as
Exceptions have to be handled if the number is exceeding the integer limit.
Status (say Pass or Fail)
Consider the below API function :
1. Lock()
2. Unlock()
3. Delete()
They return any value such as True (in case of success) or false (In case of error) as an
output.
Maybe need more than one test case, call the functions and check for change of
Database or GUI
Calling of another API / Event
In this case, we call one of the API function which in turn will call another function.
For example - First API function can be used for deleting a specified record in the table
and this function in turn calls another function to REFRESH the database.
Test Cases for API Testing
Return value based on input condition: it is relatively easy to test, as input can be
defined and results can be authenticated
Does not return anything: When there is no return value, behavior of API on the
system to be checked
Trigger some other API/event/interrupt: If output of an API triggers some event or
interrupt, then those events and interrupt listeners should be tracked
Update data structure: Updating data structure will have some outcome or effect on the
system, and that should be authenticated
Modify certain resources: If API call modifies some resources then it should be
validated by accessing respective resources
Approach of API Testing
- Understanding the functionality of the API program and clearly define the scope of the
program
- Apply testing techniques such as equivalence classes, boundary value analysis and error
guessing and write test cases for the API
- Input Parameters for the API need to be planned and defined appropriately
- Execute the test cases and compare expected and actual results.
Difference between API testing and Unit testing
What to test for in API testing
•Discovery testing: The test group should manually execute the set of calls documented in
the API like verifying that a specific resource exposed by the API can be listed, created and
deleted as appropriate
•Usability testing: This testing verifies whether the API is functional and user-friendly. And
does API integrates well with another platform as well
•Security testing: This testing includes what type of authentication is required and whether
sensitive data is encrypted over HTTP or both
•Automated testing: API testing should culminate in the creation of a set of scripts or a tool
that can be used to execute the API regularly
•Documentation: The test team has to make sure that the documentation is adequate and
provides enough information to interact with the API. Documentation should be a part of the
final deliverable
Best Practices of API Testing:
•Test cases should be grouped by test category
•On top each test, you should include the declarations of the APIs being called.
•Parameters selection should be explicitly mentioned in the test case itself
•Prioritize API function calls so that it will be easy for testers to test
•Each test case should be as self-contained and independent from dependencies as possible
•Avoid "test chaining" in your development
•Special care must be taken while handling one time call functions like - Delete, CloseWindow,
etc...
•Call sequencing should be performed and well planned
•To ensure complete test coverage, create test cases for all possible input combinations of the
API.
Types of Bugs that API testing detects
•Fails to handle error conditions gracefully
•Unused flags
•Missing or duplicate functionality
•Reliability Issues. Difficulty in connecting and getting a response from API.
•Security Issues
•Multi-threading issues
•Performance Issues. API response time is very high.
•Improper errors/warning to caller
•Incorrect handling of valid argument values
•Response Data is not structured correctly (JSON or XML)
Tools for API testing
Since API and Unit Testing both target source code, similar tools can
be used for testing both.
•SOAPUI - It's an easy-to-use tool with extensive REST and SOAP
API testing capabilities – no scripting experience is required.
•Runscope
•Postman with jetpacks
•Postman with Newman
•Curl
•Cfix
•Check
•CTESK
•dotTEST
•Eclipse SDK tool- Automated API testing
Check out top API Testing Tools List
Challenges of API Testing
Challenges of API testing includes:
- Main challenges in API testing is Parameter Combination, Parameter Selection, and Call
Sequencing
- There is no GUI available to test the application which makes difficult to give input values
- Validating and Verifying the output in different system is little difficult for testers
- Parameters selection and categorization is required to be known to the testers
- Exception handling function needs to be tested
- Coding knowledge is necessary for testers
DEMO
Demo
Result
Book
Demo
Members:
Nguyễn Duy Huy - N14DCCN029
Tô Xuân Hưởng - N14DCCN178
Nguyễn Duy Khoa - N14DCCN246
Trần Huỳnh Anh Khoa - N14DCCN061
Đồng Văn Sơn - N14DCCN105
Trương Hoàng Vĩnh - N14DCCN121
Trần Phúc Trình - N14DCCN074
Lê Trương Tuấn Nhân - N14DCCN239
Lương Tấn Trọng - N14DCCN051
Đỗ Hoàng Long - N14DCCN300
Võ Nguyễn Thành Lộc - N14DCCN049
Hà Võ Anh Nguyên - N14DCCN256
B4USolution_API-Testing
1 de 31

Recomendados

Api Testing por
Api TestingApi Testing
Api TestingVishwanath KC
1.4K vistas20 diapositivas
Api testing por
Api testingApi testing
Api testingHamzaMajid13
827 vistas19 diapositivas
API Testing por
API TestingAPI Testing
API TestingBikash Sharma
7.8K vistas9 diapositivas
API Testing: The heart of functional testing" with Bj Rollison por
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 RollisonTEST Huddle
8K vistas17 diapositivas
API Testing Presentations.pptx por
API Testing Presentations.pptxAPI Testing Presentations.pptx
API Testing Presentations.pptxManmitSalunke
119 vistas13 diapositivas
How to Automate API Testing por
How to Automate API TestingHow to Automate API Testing
How to Automate API TestingBruno Pedro
7.9K vistas27 diapositivas

Más contenido relacionado

La actualidad más candente

An Introduction To Automated API Testing por
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API TestingSauce Labs
4.1K vistas23 diapositivas
Api Testing por
Api TestingApi Testing
Api TestingVishwanath KC
558 vistas20 diapositivas
API Test Automation por
API Test Automation API Test Automation
API Test Automation SQALab
1.9K vistas26 diapositivas
An introduction to api testing | David Tzemach por
An introduction to api testing | David TzemachAn introduction to api testing | David Tzemach
An introduction to api testing | David TzemachDavid Tzemach
1.5K vistas15 diapositivas
4 Major Advantages of API Testing por
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API TestingQASource
8K vistas20 diapositivas
API TESTING por
API TESTINGAPI TESTING
API TESTINGSijan Bhandari
591 vistas23 diapositivas

La actualidad más candente(20)

An Introduction To Automated API Testing por Sauce Labs
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
Sauce Labs4.1K vistas
API Test Automation por SQALab
API Test Automation API Test Automation
API Test Automation
SQALab1.9K vistas
An introduction to api testing | David Tzemach por David Tzemach
An introduction to api testing | David TzemachAn introduction to api testing | David Tzemach
An introduction to api testing | David Tzemach
David Tzemach1.5K vistas
4 Major Advantages of API Testing por QASource
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
QASource8K vistas
Presentation for soap ui por Anjali Rao
Presentation for soap uiPresentation for soap ui
Presentation for soap ui
Anjali Rao3.5K vistas
Space Camp June 2022 - API First.pdf por Postman
Space Camp June 2022 - API First.pdfSpace Camp June 2022 - API First.pdf
Space Camp June 2022 - API First.pdf
Postman171 vistas
API Test Automation Tips and Tricks por testhive
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Tricks
testhive817 vistas
Test Design and Automation for REST API por Ivan Katunou
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST API
Ivan Katunou882 vistas
RESTful API Testing using Postman, Newman, and Jenkins por QASymphony
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
QASymphony 5.5K vistas
Postman Webinar: Postman 101 por Nikita Sharma
Postman Webinar: Postman 101Postman Webinar: Postman 101
Postman Webinar: Postman 101
Nikita Sharma413 vistas
Postman. From simple API test to end to end scenario por HYS Enterprise
Postman. From simple API test to end to end scenarioPostman. From simple API test to end to end scenario
Postman. From simple API test to end to end scenario
HYS Enterprise2.5K vistas
Reasons To Automate API Testing Process por QASource
Reasons To Automate API Testing ProcessReasons To Automate API Testing Process
Reasons To Automate API Testing Process
QASource979 vistas
Automate REST API Testing por TechWell
Automate REST API TestingAutomate REST API Testing
Automate REST API Testing
TechWell3.1K vistas
API Testing. Streamline your testing process. por Andrey Oleynik
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
Andrey Oleynik793 vistas
API Testing Using REST Assured with TestNG por Siddharth Sharma
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
Siddharth Sharma1K vistas

Similar a B4USolution_API-Testing

Webservicex.pdf por
Webservicex.pdfWebservicex.pdf
Webservicex.pdfssuser751c981
53 vistas25 diapositivas
Api Testing.pdf por
Api Testing.pdfApi Testing.pdf
Api Testing.pdfJitendraYadav351971
41 vistas14 diapositivas
API testing - Japura.pptx por
API testing - Japura.pptxAPI testing - Japura.pptx
API testing - Japura.pptxTharindaLiyanage1
68 vistas36 diapositivas
Accelerating Software Product Development with API Testing por
Accelerating Software Product Development with API TestingAccelerating Software Product Development with API Testing
Accelerating Software Product Development with API TestingMindfire LLC
47 vistas20 diapositivas
Do’s and don’ts of api testing por
Do’s and don’ts of api testingDo’s and don’ts of api testing
Do’s and don’ts of api testingwebomates
66 vistas10 diapositivas
API Check Overview - Rigor Monitoring por
API Check Overview - Rigor MonitoringAPI Check Overview - Rigor Monitoring
API Check Overview - Rigor MonitoringAnthony Ferrari
6.2K vistas40 diapositivas

Similar a B4USolution_API-Testing(20)

Accelerating Software Product Development with API Testing por Mindfire LLC
Accelerating Software Product Development with API TestingAccelerating Software Product Development with API Testing
Accelerating Software Product Development with API Testing
Mindfire LLC47 vistas
Do’s and don’ts of api testing por webomates
Do’s and don’ts of api testingDo’s and don’ts of api testing
Do’s and don’ts of api testing
webomates 66 vistas
API Check Overview - Rigor Monitoring por Anthony Ferrari
API Check Overview - Rigor MonitoringAPI Check Overview - Rigor Monitoring
API Check Overview - Rigor Monitoring
Anthony Ferrari6.2K vistas
Planet of the APIs: Monitoring Transactions in the Wild por Deborah Schalm
Planet of the APIs: Monitoring Transactions in the WildPlanet of the APIs: Monitoring Transactions in the Wild
Planet of the APIs: Monitoring Transactions in the Wild
Deborah Schalm581 vistas
Planet of the APIs: Monitoring Transactions in the Wild por DevOps.com
Planet of the APIs: Monitoring Transactions in the WildPlanet of the APIs: Monitoring Transactions in the Wild
Planet of the APIs: Monitoring Transactions in the Wild
DevOps.com52 vistas
5 challenges of api testing and how to overcome por TestingXperts
5 challenges of api testing and how to overcome5 challenges of api testing and how to overcome
5 challenges of api testing and how to overcome
TestingXperts 30 vistas
Practices and tools for building better API (JFall 2013) por Peter Hendriks
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
Peter Hendriks4.5K vistas
Practices and tools for building better APIs por NLJUG
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIs
NLJUG569 vistas
Functional REST API testing in ASP.NET Core por Sorin
Functional REST API testing in ASP.NET CoreFunctional REST API testing in ASP.NET Core
Functional REST API testing in ASP.NET Core
Sorin203 vistas
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice... por Jitendra Bafna
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna1.3K vistas
Writing Acceptance Tests Using Fitnesse por Facundo Farias
Writing Acceptance Tests Using FitnesseWriting Acceptance Tests Using Fitnesse
Writing Acceptance Tests Using Fitnesse
Facundo Farias6.6K vistas
The ultimate api checklist by Blendr.io por Blendr.io
The ultimate api checklist by Blendr.ioThe ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.io
Blendr.io121 vistas

Más de b4usolution .

Agile_Scrum_B4USolution.pptx por
Agile_Scrum_B4USolution.pptxAgile_Scrum_B4USolution.pptx
Agile_Scrum_B4USolution.pptxb4usolution .
24 vistas53 diapositivas
2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptx por
2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptx2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptx
2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptxb4usolution .
106 vistas25 diapositivas
2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T... por
2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T...2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T...
2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T...b4usolution .
588 vistas35 diapositivas
2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptx por
2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptx2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptx
2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptxb4usolution .
86 vistas36 diapositivas
Agile_Scrum_B4USolution.pptx por
Agile_Scrum_B4USolution.pptxAgile_Scrum_B4USolution.pptx
Agile_Scrum_B4USolution.pptxb4usolution .
30 vistas53 diapositivas
B4USolution_Sexy qtest manager and automation tools to apply for full stack t... por
B4USolution_Sexy qtest manager and automation tools to apply for full stack t...B4USolution_Sexy qtest manager and automation tools to apply for full stack t...
B4USolution_Sexy qtest manager and automation tools to apply for full stack t...b4usolution .
1.3K vistas23 diapositivas

Más de b4usolution .(15)

Agile_Scrum_B4USolution.pptx por b4usolution .
Agile_Scrum_B4USolution.pptxAgile_Scrum_B4USolution.pptx
Agile_Scrum_B4USolution.pptx
b4usolution .24 vistas
2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptx por b4usolution .
2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptx2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptx
2022_Bài 10_Thiết kế hệ thống thông tin trong logistics_Ths.Lê Thị Bích Hòa.pptx
b4usolution .106 vistas
2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T... por b4usolution .
2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T...2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T...
2022_Bài 9_Những vấn đề cơ bản về hệ thống thông tin trong logistics_Ths.Lê T...
b4usolution .588 vistas
2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptx por b4usolution .
2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptx2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptx
2022_Bài 8_Một số ứng dụng TMDT khác và An Ninh TMDT_Ths.Lê Thị Bích Hòa.pptx
b4usolution .86 vistas
Agile_Scrum_B4USolution.pptx por b4usolution .
Agile_Scrum_B4USolution.pptxAgile_Scrum_B4USolution.pptx
Agile_Scrum_B4USolution.pptx
b4usolution .30 vistas
B4USolution_Sexy qtest manager and automation tools to apply for full stack t... por b4usolution .
B4USolution_Sexy qtest manager and automation tools to apply for full stack t...B4USolution_Sexy qtest manager and automation tools to apply for full stack t...
B4USolution_Sexy qtest manager and automation tools to apply for full stack t...
b4usolution .1.3K vistas
Sexy Using Cucumber - BDD in your project por b4usolution .
Sexy Using Cucumber - BDD in your projectSexy Using Cucumber - BDD in your project
Sexy Using Cucumber - BDD in your project
b4usolution .1.4K vistas
B4usolution_AI for automation por b4usolution .
B4usolution_AI for automationB4usolution_AI for automation
B4usolution_AI for automation
b4usolution .1.2K vistas
b4usolution_Appium Mobile Automation Testing Made Awesome por b4usolution .
b4usolution_AppiumMobile Automation Testing Made Awesomeb4usolution_AppiumMobile Automation Testing Made Awesome
b4usolution_Appium Mobile Automation Testing Made Awesome
b4usolution .1.2K vistas
B4 u solution_writing test cases from user stories and acceptance criteria por b4usolution .
B4 u solution_writing test cases from user stories and acceptance criteriaB4 u solution_writing test cases from user stories and acceptance criteria
B4 u solution_writing test cases from user stories and acceptance criteria
b4usolution .776 vistas
B4usolution git git-hub por b4usolution .
B4usolution git git-hubB4usolution git git-hub
B4usolution git git-hub
b4usolution .155 vistas
Select the right automation test tool in agile project por b4usolution .
Select the right automation test tool in agile projectSelect the right automation test tool in agile project
Select the right automation test tool in agile project
b4usolution .179 vistas
Introduction to blazemeter and jmeter por b4usolution .
Introduction to blazemeter and jmeterIntroduction to blazemeter and jmeter
Introduction to blazemeter and jmeter
b4usolution .537 vistas

Último

20231123_Camunda Meetup Vienna.pdf por
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
41 vistas73 diapositivas
Empathic Computing: Delivering the Potential of the Metaverse por
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
478 vistas80 diapositivas
Serverless computing with Google Cloud (2023-24) por
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)wesley chun
11 vistas33 diapositivas
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... por
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
85 vistas32 diapositivas
Tunable Laser (1).pptx por
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptxHajira Mahmood
24 vistas37 diapositivas
Democratising digital commerce in India-Report por
Democratising digital commerce in India-ReportDemocratising digital commerce in India-Report
Democratising digital commerce in India-ReportKapil Khandelwal (KK)
15 vistas161 diapositivas

Último(20)

Empathic Computing: Delivering the Potential of the Metaverse por Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst478 vistas
Serverless computing with Google Cloud (2023-24) por wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 vistas
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... por James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson85 vistas
Case Study Copenhagen Energy and Business Central.pdf por Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 vistas
Five Things You SHOULD Know About Postman por Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman33 vistas
SAP Automation Using Bar Code and FIORI.pdf por Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Virendra Rai, PMP23 vistas
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... por Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Jasper Oosterveld18 vistas
Piloting & Scaling Successfully With Microsoft Viva por Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Richard Harbridge12 vistas

B4USolution_API-Testing

  • 1. API Testing Group 10 – D14CQCPN01 Lecturer: Lê Thị Bích Hòa
  • 2. Type of API Webservice  -SOAP  RESTFUL
  • 3. What is SOAP?  SOAP stands for Simple Object Access Protocol. It is a XML-based protocol for accessing web services..  SOAP is XML based protocol. It is platform independent and language independent. By using SOAP, you will be able to interact with other programming language applications.
  • 4. What is REST?  REST stands for REpresentational State Transfer.  REST is an architectural style not a protocol.
  • 5. The Difference Beetween SOAP and REST APIs No. SOAP REST 1 SOAP is a protocol. REST is an architectural style. 2 SOAP stands for Simple Object Access Protocol. REST stands for REpresentational State Transfer. 3 SOAP can't use REST because it is a protocol. REST can use SOAP web services because it is a concept and can use any protocol like HTTP, SOAP 4 SOAP uses services interfaces to expose the business logic REST uses URI to expose business logic. 5 JAX-WS is the java API for SOAP web services. JAX-RS is the java API for RESTful web services. 6 SOAP defines standards to be strictly followed. REST does not define too much standards like SOAP. 7 SOAP requires more bandwidth and resource than REST. REST requires less bandwidth and resource than SOAP. 8 SOAP defines its own security. RESTful web services inherits security measures from the underlying transport. 9 SOAP permits XML data format only. REST permits different data format such as Plain text, HTML, XML, JSON etc. 10 SOAP is less preferred than REST. REST more preferred than SOAP.
  • 6. Viewing a Simple SOAP Example  Example soap: <?xml version = “1.0” encoding =“UTF-8”?> <id>01</id><name>team10</name>  Example rest : { id:”01”,name: ”team 10” }
  • 7. What is an API?
  • 8. What is an API? - An acronym for Application Programming Interface. - It enables communication and data exchange between two separate software systems.
  • 9. What is an API?
  • 10. What is API Testing? - Entirely different from GUI Testing - This testing won't concentrate on the look and feel of an application. - In Api Testing, you use software to send calls to the API, get output, and note down the system's response.
  • 11. What is API Testing?
  • 12. What is API Testing? Api Testing requires an application to interact with API. In order to test an API, you will need to + Use Testing Tool to drive the API + Write your own code to test the API
  • 13. Set-up of API Test environment - Required to setup initial environment that invokes API with required set of parameters and then finally examines the test result. - This stage, GUI maybe not available. - Setting up a testing environment for API testing seems a little complex. - Database and server should be configured as per the application requirements. - Once the installation is done, API Function should be called to check whether that API is working.
  • 14. Types of Output of an API Output of API could be: - Any type of data - Status (say Pass or Fail) - Call to another API function.
  • 15. Example: There is an API function which should add two integer numbers. - The numbers have to be given as input parameters. - The output should be a summation of two integer numbers. - This output needs to be verified with expected outcome. - Calling needs to be done such as Exceptions have to be handled if the number is exceeding the integer limit.
  • 16. Status (say Pass or Fail) Consider the below API function : 1. Lock() 2. Unlock() 3. Delete() They return any value such as True (in case of success) or false (In case of error) as an output. Maybe need more than one test case, call the functions and check for change of Database or GUI
  • 17. Calling of another API / Event In this case, we call one of the API function which in turn will call another function. For example - First API function can be used for deleting a specified record in the table and this function in turn calls another function to REFRESH the database.
  • 18. Test Cases for API Testing Return value based on input condition: it is relatively easy to test, as input can be defined and results can be authenticated Does not return anything: When there is no return value, behavior of API on the system to be checked Trigger some other API/event/interrupt: If output of an API triggers some event or interrupt, then those events and interrupt listeners should be tracked Update data structure: Updating data structure will have some outcome or effect on the system, and that should be authenticated Modify certain resources: If API call modifies some resources then it should be validated by accessing respective resources
  • 19. Approach of API Testing - Understanding the functionality of the API program and clearly define the scope of the program - Apply testing techniques such as equivalence classes, boundary value analysis and error guessing and write test cases for the API - Input Parameters for the API need to be planned and defined appropriately - Execute the test cases and compare expected and actual results.
  • 20. Difference between API testing and Unit testing
  • 21. What to test for in API testing •Discovery testing: The test group should manually execute the set of calls documented in the API like verifying that a specific resource exposed by the API can be listed, created and deleted as appropriate •Usability testing: This testing verifies whether the API is functional and user-friendly. And does API integrates well with another platform as well •Security testing: This testing includes what type of authentication is required and whether sensitive data is encrypted over HTTP or both •Automated testing: API testing should culminate in the creation of a set of scripts or a tool that can be used to execute the API regularly •Documentation: The test team has to make sure that the documentation is adequate and provides enough information to interact with the API. Documentation should be a part of the final deliverable
  • 22. Best Practices of API Testing: •Test cases should be grouped by test category •On top each test, you should include the declarations of the APIs being called. •Parameters selection should be explicitly mentioned in the test case itself •Prioritize API function calls so that it will be easy for testers to test •Each test case should be as self-contained and independent from dependencies as possible •Avoid "test chaining" in your development •Special care must be taken while handling one time call functions like - Delete, CloseWindow, etc... •Call sequencing should be performed and well planned •To ensure complete test coverage, create test cases for all possible input combinations of the API.
  • 23. Types of Bugs that API testing detects •Fails to handle error conditions gracefully •Unused flags •Missing or duplicate functionality •Reliability Issues. Difficulty in connecting and getting a response from API. •Security Issues •Multi-threading issues •Performance Issues. API response time is very high. •Improper errors/warning to caller •Incorrect handling of valid argument values •Response Data is not structured correctly (JSON or XML)
  • 24. Tools for API testing Since API and Unit Testing both target source code, similar tools can be used for testing both. •SOAPUI - It's an easy-to-use tool with extensive REST and SOAP API testing capabilities – no scripting experience is required. •Runscope •Postman with jetpacks •Postman with Newman •Curl •Cfix •Check •CTESK •dotTEST •Eclipse SDK tool- Automated API testing Check out top API Testing Tools List
  • 25. Challenges of API Testing Challenges of API testing includes: - Main challenges in API testing is Parameter Combination, Parameter Selection, and Call Sequencing - There is no GUI available to test the application which makes difficult to give input values - Validating and Verifying the output in different system is little difficult for testers - Parameters selection and categorization is required to be known to the testers - Exception handling function needs to be tested - Coding knowledge is necessary for testers
  • 26. DEMO
  • 28. Book
  • 29. Demo
  • 30. Members: Nguyễn Duy Huy - N14DCCN029 Tô Xuân Hưởng - N14DCCN178 Nguyễn Duy Khoa - N14DCCN246 Trần Huỳnh Anh Khoa - N14DCCN061 Đồng Văn Sơn - N14DCCN105 Trương Hoàng Vĩnh - N14DCCN121 Trần Phúc Trình - N14DCCN074 Lê Trương Tuấn Nhân - N14DCCN239 Lương Tấn Trọng - N14DCCN051 Đỗ Hoàng Long - N14DCCN300 Võ Nguyễn Thành Lộc - N14DCCN049 Hà Võ Anh Nguyên - N14DCCN256