SlideShare ist ein Scribd-Unternehmen logo
1 von 20
API Test Automation
Using Karate
Current state
• Tests only at presentation layer
• No tests at Business layer/API layer ->
• Potential Defects missed
• DB Vulnerable
• Downstream systems affected
3.5 Hours to complete testing
Why API testing?
Fast and
reliable
Integrated
with every
dev
commit
Catch the
defects
early
Helps us
in No-Fear
releases
REST Methods
HTTP/REST CRUD DB
POST Create INSERT
GET Retrieve SELECT
PUT Update UPDATE
DELETE Delete DELETE
Karate Framework
I want to test web services and
currently use Java
I want to test web services but don’t
know Java/any programming
I develop web services
I am part of a team that
develops/maintains web services
Karate is easier and efficient than
Java
Karate scripts are in plain text
Karate can be used for TDD
Karate increases your velocity and
integrates existing QA and CI/CD
Hello World Example
API testing made simple
Plain text,calling another feature file,JSON payload and order doesn’t matter, Data driven test, Easy
assertions via JSON path
API testing made simple
JSON Array Support
Reading JSON files and manipulating
API testing made simple
Multipart and file uploading
Full JSON response validation in one line
Partial JSON response validation in one line
GraphQL Example with RegEx
Karate vs Rest-assured and Cucumber
Rest-assured Karate
Plain text No Yes
Parallel execution Partial Yes
Data driven testing Not built in Built in
Cucumber enhancements
Cucumber Karate
Built in step definitions No Yes
Re use feature files No Yes
Parallel execution No Yes
Run background only once No Yes
JSON path,RegEx & JavaScript Functions
JSON Schema
Karate vs Rest Assured
Less code = Less maintenance and more efficient
API Testing Values
Pipeline integration
• Can run full
regression with
every code commit
in less than 15 mins
• Enable no fear
release
Improve test
development
efficiency
• Can develop tests
way much faster
compared to UI tests
• Very minimal to 0
maintenance
Can identify API risks
• Identifies defects at
API level which
may not be visible in
GUI
• Prevents DB from
invalid entires
Pipeline with API tests
Reporting
Cucumber Report
Since Karate’s REST test tool is built on
top of Cucumber JVM, you can run your
tests, view reports and leverage any other
Cucumber functionality just as with any
standard java project
Karate key features
Open source
Multi-threaded Parallel
execution support
Integration with Pipeline
jobs
Cucumber based ,
Gherkin Syntax
Re-usable functions and
feature files
Less code = More
efficiency and Less
maintenance
Syntax 'natively'
supports JSON and XML
No CERTS and no
POJO’s required
Easy Assertion; Re-
usable scripts for
complex payloads and
responses
Embedded JavaScript
engine
Integration with Junit &
TestNG
Built-in JSON Schema
Validation support
Demo

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

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
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
 
BDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service TestsBDD Approach with Karate Framework in Service Tests
BDD Approach with Karate Framework in Service Tests
 
Rest assured
Rest assuredRest assured
Rest assured
 
API Testing
API TestingAPI Testing
API Testing
 
Testing microservices with rest assured
Testing microservices with rest assuredTesting microservices with rest assured
Testing microservices with rest assured
 
Test your microservices with REST-Assured
Test your microservices with REST-AssuredTest your microservices with REST-Assured
Test your microservices with REST-Assured
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 
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
 
Api Testing
Api TestingApi Testing
Api Testing
 
2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured
 
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
 
Postman
PostmanPostman
Postman
 
Getting started with karate dsl
Getting started with karate dslGetting started with karate dsl
Getting started with karate dsl
 
Rest assured
Rest assuredRest assured
Rest assured
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST API
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
 
Reasons To Automate API Testing Process
Reasons To Automate API Testing ProcessReasons To Automate API Testing Process
Reasons To Automate API Testing Process
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 

Ähnlich wie API Test Automation Using Karate (Anil Kumar Moka)

Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
QA or the Highway
 

Ähnlich wie API Test Automation Using Karate (Anil Kumar Moka) (20)

Brightcove presentation on Automated Testing
Brightcove presentation on Automated TestingBrightcove presentation on Automated Testing
Brightcove presentation on Automated Testing
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
 
QAorHighway2016
QAorHighway2016QAorHighway2016
QAorHighway2016
 
Neotys PAC 2018 - Ramya Ramalinga Moorthy
Neotys PAC 2018 - Ramya Ramalinga MoorthyNeotys PAC 2018 - Ramya Ramalinga Moorthy
Neotys PAC 2018 - Ramya Ramalinga Moorthy
 
Functional REST API testing in ASP.NET Core
Functional REST API testing in ASP.NET CoreFunctional REST API testing in ASP.NET Core
Functional REST API testing in ASP.NET Core
 
LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧LINE TODAY高效率的敏捷測試開發技巧
LINE TODAY高效率的敏捷測試開發技巧
 
B4USolution_API-Testing
B4USolution_API-TestingB4USolution_API-Testing
B4USolution_API-Testing
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Continuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQContinuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQ
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
 
Test Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+SahiTest Framework for Acne Selenium+Sahi
Test Framework for Acne Selenium+Sahi
 
Selenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabad Selenium course training institute ameerpet hyderabad
Selenium course training institute ameerpet hyderabad
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...
 
Modern software testing and processes 2019
Modern software testing and processes 2019Modern software testing and processes 2019
Modern software testing and processes 2019
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration Monday
 
Effective performance evaluation as part of a CI approach - Mission Impossible?
Effective performance evaluation as part of a CI approach - Mission Impossible?Effective performance evaluation as part of a CI approach - Mission Impossible?
Effective performance evaluation as part of a CI approach - Mission Impossible?
 
Story Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkStory Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium Framework
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
 
Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014
 
[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps
[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps
[Webinar] Test First, Fail Fast - Simplifying the Tester's Transition to DevOps
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

API Test Automation Using Karate (Anil Kumar Moka)

  • 2. Current state • Tests only at presentation layer • No tests at Business layer/API layer -> • Potential Defects missed • DB Vulnerable • Downstream systems affected 3.5 Hours to complete testing
  • 3. Why API testing? Fast and reliable Integrated with every dev commit Catch the defects early Helps us in No-Fear releases
  • 4. REST Methods HTTP/REST CRUD DB POST Create INSERT GET Retrieve SELECT PUT Update UPDATE DELETE Delete DELETE
  • 5. Karate Framework I want to test web services and currently use Java I want to test web services but don’t know Java/any programming I develop web services I am part of a team that develops/maintains web services Karate is easier and efficient than Java Karate scripts are in plain text Karate can be used for TDD Karate increases your velocity and integrates existing QA and CI/CD
  • 6.
  • 8. API testing made simple Plain text,calling another feature file,JSON payload and order doesn’t matter, Data driven test, Easy assertions via JSON path
  • 9. API testing made simple JSON Array Support Reading JSON files and manipulating
  • 10. API testing made simple Multipart and file uploading Full JSON response validation in one line Partial JSON response validation in one line
  • 12. Karate vs Rest-assured and Cucumber Rest-assured Karate Plain text No Yes Parallel execution Partial Yes Data driven testing Not built in Built in Cucumber enhancements Cucumber Karate Built in step definitions No Yes Re use feature files No Yes Parallel execution No Yes Run background only once No Yes
  • 13. JSON path,RegEx & JavaScript Functions
  • 15. Karate vs Rest Assured Less code = Less maintenance and more efficient
  • 16. API Testing Values Pipeline integration • Can run full regression with every code commit in less than 15 mins • Enable no fear release Improve test development efficiency • Can develop tests way much faster compared to UI tests • Very minimal to 0 maintenance Can identify API risks • Identifies defects at API level which may not be visible in GUI • Prevents DB from invalid entires
  • 18. Reporting Cucumber Report Since Karate’s REST test tool is built on top of Cucumber JVM, you can run your tests, view reports and leverage any other Cucumber functionality just as with any standard java project
  • 19. Karate key features Open source Multi-threaded Parallel execution support Integration with Pipeline jobs Cucumber based , Gherkin Syntax Re-usable functions and feature files Less code = More efficiency and Less maintenance Syntax 'natively' supports JSON and XML No CERTS and no POJO’s required Easy Assertion; Re- usable scripts for complex payloads and responses Embedded JavaScript engine Integration with Junit & TestNG Built-in JSON Schema Validation support
  • 20. Demo