SlideShare a Scribd company logo
1 of 11
TEST THE REST
TESTING RESTFUL WEBSERVICES USING REST ASSURED
WHAT ISTHE REST
• REST (REpresentational State Transfer) is an architectural style, and an approach to
communications that is often used in the development of Web Services
• REST uses HTTP protocols to communicate between producer and consumers.
• HTTP Methods:- GET, POST, PUT, DELETE
• Working with URL’s
EXAMPLE OF GET REQUEST
WHY API AUTOMATION REQUIRED?
1.Early Defect Detection:-
Most of the time UI layer users the REST Web services to fetch the data from back end and do the
business validation. If their are any issue with the REST services, It will be found before the
developers actually consumer that web services. It will saves the development time over the
defected web services.
2.Contract Validation:-
In distributed environment different scrum teams are involved in development the single
functionality. In this case suppose a scrum team changes the some parameters related to a web
service which was consume by your team in last spring and they failed to notify your team. This
situation leads to a production detect of that functionality which you have not touched in the current
sprint. so validating contact is necessary thing.
3.Stops the further build:-
If a test failed in Jenkins automation environment, It stops the further build unless that error is
rectified. Which assured that only good build pass to manual testers for testing.
WHY API AUTOMATION REQUIRED?
4.Fast Result:-
API Automation test jobs took very less time to complete the
one testing cycle. this help in automating the regression suit
for an application. This will very helpful in CICD (Continuous
Integration, Continuous Deployment) environments.
5.Reliable :-
If these test are passed without any issue then we can sure
that business layer is not having any defect.
6.Test Pyramid:-
API Automation involves significant role in building the test
pyramid. As the after the unit test cases it comes
with majority of numbers. Which helps overall automation
framework
WHAT IS A REST ASSURED:-
• Testing and validating REST services in Java is harder than in dynamic languages such as Ruby
and Groovy. REST Assured brings the simplicity of using these languages into the Java domain.
• REST Assured is a simple Java library for testing of REST services.
• Integrates seamlessly with existing Java based testing frameworks
• Junit, TestNG
• Selenium Webdriver
• Rest Assured features
• Supports for HTTP methods
• Supports for BDD/Gherkin(Given, When, Then)
• Use of Hamcrest matches for checks (equalTo)
• Use of Gpath for selecting element from JSON response.
WHAT IS A REST ASSURED GIVES:-
• It gives various methods to
• 1. format the HTTP request
• 2. send it over a network
• 3. validating HTTP status code of an request
• 4. Finally validating response data.
• It also handles the various authentication mechanism for the REST Requests
• 1. Basic Authentication(with username and password)
• 2. OAuth
• 3. OAuth 2.0
• 4. Certificates
• 5. Digest
• 6. Form based authentication
GETTING STARTEDWITH REST ASSURED:-
1. Maven Dependency of REST Assured
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
WRITINGTHETEST
GETTING STARTEDWITH REST ASSURED:-
1. For HTTP GET Request
• request = given()
.contentType("application/json“)
.auth()
.basic(authData.getUserName(),authData.getPassword())
.when()
.get(url);
THANK YOU
VARUN DESHPANDE

More Related Content

What's hot

What's hot (20)

An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
 
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
 
API Testing for everyone.pptx
API Testing for everyone.pptxAPI Testing for everyone.pptx
API Testing for everyone.pptx
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
API Testing
API TestingAPI Testing
API Testing
 
Rest assured
Rest assuredRest assured
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
 
API TESTING
API TESTINGAPI TESTING
API TESTING
 
Api Testing
Api TestingApi Testing
Api Testing
 
Api testing bible using postman
Api testing bible using postmanApi testing bible using postman
Api testing bible using postman
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
 
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
 
Automated Test Framework with Cucumber
Automated Test Framework with CucumberAutomated Test Framework with Cucumber
Automated Test Framework with Cucumber
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
Postman: An Introduction for Testers
Postman: An Introduction for TestersPostman: An Introduction for Testers
Postman: An Introduction for Testers
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Cucumber ppt
Cucumber pptCucumber ppt
Cucumber ppt
 

Viewers also liked

Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIs
SmartBear
 
Automation framework
Automation framework Automation framework
Automation framework
ITeLearn
 
WSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and AdoptionWSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and Adoption
WSO2
 
Automate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using JavaAutomate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using Java
ayman diab
 
TestNG introduction
TestNG introductionTestNG introduction
TestNG introduction
Denis Bazhin
 

Viewers also liked (20)

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
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Creating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat ApplicationCreating a Java EE 7 Websocket Chat Application
Creating a Java EE 7 Websocket Chat Application
 
Api testing
Api testingApi testing
Api testing
 
Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIs
 
Testing web services
Testing web servicesTesting web services
Testing web services
 
AWS API Framework Overview
AWS API Framework OverviewAWS API Framework Overview
AWS API Framework Overview
 
Continuous Automated Deployment with Apache ACE
Continuous Automated Deployment with Apache ACEContinuous Automated Deployment with Apache ACE
Continuous Automated Deployment with Apache ACE
 
TestNg_Overview_Config
TestNg_Overview_ConfigTestNg_Overview_Config
TestNg_Overview_Config
 
Automation With A Tool Demo
Automation With A Tool DemoAutomation With A Tool Demo
Automation With A Tool Demo
 
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
 
Test NG Framework Complete Walk Through
Test NG Framework Complete Walk ThroughTest NG Framework Complete Walk Through
Test NG Framework Complete Walk Through
 
Introduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit frameworkIntroduction of TestNG framework and its benefits over Junit framework
Introduction of TestNG framework and its benefits over Junit framework
 
TestNG vs JUnit: cease fire or the end of the war
TestNG vs JUnit: cease fire or the end of the warTestNG vs JUnit: cease fire or the end of the war
TestNG vs JUnit: cease fire or the end of the war
 
Automation framework
Automation framework Automation framework
Automation framework
 
WSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and AdoptionWSO2 Test Automation Framework : Approach and Adoption
WSO2 Test Automation Framework : Approach and Adoption
 
Automate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using JavaAutomate WebServices Rest API (testing) using Java
Automate WebServices Rest API (testing) using Java
 
Javascript like objects and JSON processing in VBA
Javascript like objects and JSON processing in VBAJavascript like objects and JSON processing in VBA
Javascript like objects and JSON processing in VBA
 
TestNG introduction
TestNG introductionTestNG introduction
TestNG introduction
 
Junit and testNG
Junit and testNGJunit and testNG
Junit and testNG
 

Similar to Rest assured

Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
CIVEL Benoit
 
ott_calfee_resume
ott_calfee_resumeott_calfee_resume
ott_calfee_resume
Ott Calfee
 

Similar to Rest assured (20)

ATAGTR2017 Test the REST
ATAGTR2017 Test the REST ATAGTR2017 Test the REST
ATAGTR2017 Test the REST
 
Writing Acceptance Tests Using Fitnesse
Writing Acceptance Tests Using FitnesseWriting Acceptance Tests Using Fitnesse
Writing Acceptance Tests Using Fitnesse
 
Structured Functional Automated Web Service Testing
Structured Functional Automated Web Service TestingStructured Functional Automated Web Service Testing
Structured Functional Automated Web Service Testing
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Business Applications Integration In The Cloud
Business Applications Integration In The CloudBusiness Applications Integration In The Cloud
Business Applications Integration In The Cloud
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
 
Ncerc rlmca202 adm m4 ssm
Ncerc rlmca202 adm m4 ssmNcerc rlmca202 adm m4 ssm
Ncerc rlmca202 adm m4 ssm
 
No Devops Without Continuous Testing
No Devops Without Continuous TestingNo Devops Without Continuous Testing
No Devops Without Continuous Testing
 
From Monoliths to Microservices at Realestate.com.au
From Monoliths to Microservices at Realestate.com.auFrom Monoliths to Microservices at Realestate.com.au
From Monoliths to Microservices at Realestate.com.au
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Performance testing material
Performance testing materialPerformance testing material
Performance testing material
 
Do not automate GUI testing
Do not automate GUI testingDo not automate GUI testing
Do not automate GUI testing
 
28791456 web-testing
28791456 web-testing28791456 web-testing
28791456 web-testing
 
Neev QA Offering
Neev QA OfferingNeev QA Offering
Neev QA Offering
 
Why vREST?
Why vREST?Why vREST?
Why vREST?
 
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
 
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
 
Rayudu_Grandhi
Rayudu_GrandhiRayudu_Grandhi
Rayudu_Grandhi
 
ott_calfee_resume
ott_calfee_resumeott_calfee_resume
ott_calfee_resume
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Recently uploaded (20)

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

Rest assured

  • 1. TEST THE REST TESTING RESTFUL WEBSERVICES USING REST ASSURED
  • 2. WHAT ISTHE REST • REST (REpresentational State Transfer) is an architectural style, and an approach to communications that is often used in the development of Web Services • REST uses HTTP protocols to communicate between producer and consumers. • HTTP Methods:- GET, POST, PUT, DELETE • Working with URL’s
  • 3. EXAMPLE OF GET REQUEST
  • 4. WHY API AUTOMATION REQUIRED? 1.Early Defect Detection:- Most of the time UI layer users the REST Web services to fetch the data from back end and do the business validation. If their are any issue with the REST services, It will be found before the developers actually consumer that web services. It will saves the development time over the defected web services. 2.Contract Validation:- In distributed environment different scrum teams are involved in development the single functionality. In this case suppose a scrum team changes the some parameters related to a web service which was consume by your team in last spring and they failed to notify your team. This situation leads to a production detect of that functionality which you have not touched in the current sprint. so validating contact is necessary thing. 3.Stops the further build:- If a test failed in Jenkins automation environment, It stops the further build unless that error is rectified. Which assured that only good build pass to manual testers for testing.
  • 5. WHY API AUTOMATION REQUIRED? 4.Fast Result:- API Automation test jobs took very less time to complete the one testing cycle. this help in automating the regression suit for an application. This will very helpful in CICD (Continuous Integration, Continuous Deployment) environments. 5.Reliable :- If these test are passed without any issue then we can sure that business layer is not having any defect. 6.Test Pyramid:- API Automation involves significant role in building the test pyramid. As the after the unit test cases it comes with majority of numbers. Which helps overall automation framework
  • 6. WHAT IS A REST ASSURED:- • Testing and validating REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain. • REST Assured is a simple Java library for testing of REST services. • Integrates seamlessly with existing Java based testing frameworks • Junit, TestNG • Selenium Webdriver • Rest Assured features • Supports for HTTP methods • Supports for BDD/Gherkin(Given, When, Then) • Use of Hamcrest matches for checks (equalTo) • Use of Gpath for selecting element from JSON response.
  • 7. WHAT IS A REST ASSURED GIVES:- • It gives various methods to • 1. format the HTTP request • 2. send it over a network • 3. validating HTTP status code of an request • 4. Finally validating response data. • It also handles the various authentication mechanism for the REST Requests • 1. Basic Authentication(with username and password) • 2. OAuth • 3. OAuth 2.0 • 4. Certificates • 5. Digest • 6. Form based authentication
  • 8. GETTING STARTEDWITH REST ASSURED:- 1. Maven Dependency of REST Assured <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>3.0.1</version> <scope>test</scope> </dependency>
  • 10. GETTING STARTEDWITH REST ASSURED:- 1. For HTTP GET Request • request = given() .contentType("application/json“) .auth() .basic(authData.getUserName(),authData.getPassword()) .when() .get(url);