SlideShare a Scribd company logo
1 of 21
Download to read offline
Web Services Testing
Natalia Rikhmayer,
QA Automation Engineer, DataArt
• Experienced in :
• Web,
• Web Mobile,
• Mobile Native,
• API
• Currently work on API automation



What about you? :)
Lets’s get acquainted!
Test Pyramid
https://martinfowler.com/bliki/TestPyramid.html
•
Why is it important?
Agenda
‣ What is API?
‣ Basic definitions
‣ HTTP request/response
‣ SOAP, example
‣ REST, example
‣ API testing tools
‣ REST-Assured framework
‣ Examples
What is Application Programming Interface (API)?
Basic definitions
‣ HTTP
‣ The most used HTTP Methods (CRUD operations)
– POST - Create
– GET - Read
– PUT - Update/replace
– DELETE - Delete
‣ Headers
HTTP request/response
Example
HTTP Status Codes
‣ 1XX: Informational
‣ 2XX: Success
‣ 3XX: Redirection
‣ 4XX: Client Error
‣ 5XX: Server Error
‣ There are over 70 HTTP status codes (!).
‣ Everything worked
‣ The application did something wrong
‣ The API did something wrong
http://blog.restcase.com/rest-api-error-codes-101/
➡ 200 - OK
➡ 400 - Bad Request
➡ 500 - Internal Server Error
Everything is going to be 200 OK :)
HTTP Status Code Description
‣ 200 OK - Response to a successful REST API action
‣ 400 Bad Request - The request is malformed, such as message body format error
‣ 401 Unauthorized - Wrong or no authentication ID/password provided
‣ 403 Forbidden - It's used when the authentication succeeded but authenticated user doesn't have
permission to the request resource
‣ 404 Not Found - When a non-existent resource is requested
‣ 405 Method Not Allowed - The error checking for unexpected HTTP method. For example, the
RestAPI is expecting HTTP GET, but HTTP PUT is used
‣ 429 Too Many Requests - The error is used when there may be DOS attack detected or the
request is rejected due to rate limiting
Representational State Transfer (REST)
‣RESTful applications use HTTP methods
‣data available as resources (nouns), I.e. “user”
‣hard to enforce authorization and security on top of it
‣relatively easy to implement and maintain
‣clearly separates client and server implementations
‣can return data in multiple formats (JSON, XML etc)
‣Scalability, maintainability
‣Demo
https://dzone.com/articles/j2ee-compare-restful-vs-soap https://habrahabr.ru/post/131343/ https://nordicapis.com/rest-vs-soap-nordic-apis-infographic-comparison/
‣ Examples
Slack API
LinkedIn API
Twitter API
Simple Object Access Protocol (SOAP)
‣data available as services (verb+noun), I.e. “getUser”
‣follows a formal enterprise approach (its a standard)
‣works on top of any communication protocol
‣security and authorization are part of the protocol
‣can be fully described using WSDL (e.g. put your WSDL url to generate Java/Objective-C/Swift
classes http://easywsdl.com/WsdlGenerator#)
‣hard to implement and is unpopular among Web and mobile developers
‣uses only XML
https://dzone.com/articles/j2ee-compare-restful-vs-soap https://habrahabr.ru/post/131343/ https://nordicapis.com/rest-vs-soap-nordic-apis-infographic-comparison/
‣ Examples
Salesforce SOAP API
Paypal SOAP API
Clickatell SMS SOAP API
Common types of API testing
• Verify API Response Code
• Based on input request, response should be checked
• Verification of the updating some data structure
• Delays in API Response time
• Response Data structure
• Security testing
Useful Tools
Rest assured - Java, RestSharp - C#
Airborne - Ruby, Apickli - JS
Retrofit - Android/JAVA… and other
Rest-assured
@Test(groups = {APIConfig.login_ID})
public void login() {
Logger.info("Verify login");
String loginURL = getModifiedURI(LOGIN_URI, "v1");
String token =
given()
.contentType(ContentType.JSON)
.body("{n" +
" "UserId": " + userId + ",n" +
" "Email": "" + email + "",n" +
" "ScreenName": "" + screenName + ""n" +
"}")
.when()
.post(loginURL)
.then()
.assertThat()
.statusCode(HttpURLConnection.HTTP_OK)
.extract()
.path(AUTH_TOKEN_KEY);
assertFalse(token.isEmpty(), "User Token should not be empty");
}
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.0.0</version>
</dependency>
To automate or not to automate on API level?
‣ Login
‣ Registration
‣ Join/leave group
‣ Ban/unban for 30 min
‣ Confirmation via email
‣ Subscription
‣ Navigation
‣ Article verification
Challenges of API testing
‣ Parameter Combination
‣ Parameter Selection
‣ Call Sequencing
‣ Frequent releases
‣ Delays in logging
‣ Support of auto-tests
‣ Data is changed
Advantages of API testing
‣ Access to the application without a user interface
‣ Time effective, especially automated tests
‣ Cost effective, accordingly
‣ Language-independent
‣ Test Core Functionality, once for several clients
Project examples
Thank you! Any questions?
Any further questions?
Natalia.Bilogrud@dataart.com

More Related Content

What's hot

Restful api design
Restful api designRestful api design
Restful api designMizan Riqzia
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
The REST And Then Some
The REST And Then SomeThe REST And Then Some
The REST And Then SomeNordic APIs
 
Test in Rest. API testing with the help of Rest Assured.
Test in Rest. API testing with the help of  Rest Assured.Test in Rest. API testing with the help of  Rest Assured.
Test in Rest. API testing with the help of Rest Assured.Artem Korchevyi
 
Web API testing : A quick glance
Web API testing : A quick glanceWeb API testing : A quick glance
Web API testing : A quick glanceDhanalaxmi K
 
Secure RESTful API Automation With JavaScript
Secure RESTful API Automation With JavaScriptSecure RESTful API Automation With JavaScript
Secure RESTful API Automation With JavaScriptJonathan LeBlanc
 
Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Andrey Oleynik
 
Testing REST Web Services
Testing REST Web ServicesTesting REST Web Services
Testing REST Web ServicesJan Algermissen
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
Securty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSecurty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSource Conference
 
Modern Tools for API Testing, Debugging and Monitoring
Modern Tools for API Testing, Debugging and MonitoringModern Tools for API Testing, Debugging and Monitoring
Modern Tools for API Testing, Debugging and MonitoringNeil Mansilla
 
Knowledge of web ui for automation testing
Knowledge  of web ui for automation testingKnowledge  of web ui for automation testing
Knowledge of web ui for automation testingArtem Korchevyi
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service DesignLorna Mitchell
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreStormpath
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptxHarry Potter
 
Automate REST Services Testing with RestAssured
Automate REST Services Testing with RestAssuredAutomate REST Services Testing with RestAssured
Automate REST Services Testing with RestAssuredTechWell
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practicesAnkita Mahajan
 
Do not automate GUI testing
Do not automate GUI testingDo not automate GUI testing
Do not automate GUI testingAtila Inovecký
 
2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assuredEing Ong
 

What's hot (20)

Restful api design
Restful api designRestful api design
Restful api design
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
The REST And Then Some
The REST And Then SomeThe REST And Then Some
The REST And Then Some
 
Test in Rest. API testing with the help of Rest Assured.
Test in Rest. API testing with the help of  Rest Assured.Test in Rest. API testing with the help of  Rest Assured.
Test in Rest. API testing with the help of Rest Assured.
 
Web API testing : A quick glance
Web API testing : A quick glanceWeb API testing : A quick glance
Web API testing : A quick glance
 
Secure RESTful API Automation With JavaScript
Secure RESTful API Automation With JavaScriptSecure RESTful API Automation With JavaScript
Secure RESTful API Automation With JavaScript
 
Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)
 
Testing REST Web Services
Testing REST Web ServicesTesting REST Web Services
Testing REST Web Services
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
Securty Testing For RESTful Applications
Securty Testing For RESTful ApplicationsSecurty Testing For RESTful Applications
Securty Testing For RESTful Applications
 
Modern Tools for API Testing, Debugging and Monitoring
Modern Tools for API Testing, Debugging and MonitoringModern Tools for API Testing, Debugging and Monitoring
Modern Tools for API Testing, Debugging and Monitoring
 
Knowledge of web ui for automation testing
Knowledge  of web ui for automation testingKnowledge  of web ui for automation testing
Knowledge of web ui for automation testing
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptx
 
Automate REST Services Testing with RestAssured
Automate REST Services Testing with RestAssuredAutomate REST Services Testing with RestAssured
Automate REST Services Testing with RestAssured
 
Rest api standards and best practices
Rest api standards and best practicesRest api standards and best practices
Rest api standards and best practices
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Do not automate GUI testing
Do not automate GUI testingDo not automate GUI testing
Do not automate GUI testing
 
2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured
 

Similar to Web Services Testing: API Testing Tools and REST-Assured Framework

Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slidesCisco DevNet
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you pownedDinis Cruz
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIRasan Samarasinghe
 
API testing with the help of Rest Assured
API testing with the help of  Rest Assured API testing with the help of  Rest Assured
API testing with the help of Rest Assured Artem Korchevyi
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - IntroductionHandsOnWP.com
 
Web API Test Automation using Frisby & Node.js
Web API Test Automation using Frisby  & Node.jsWeb API Test Automation using Frisby  & Node.js
Web API Test Automation using Frisby & Node.jsChi Lang Le Vu Tran
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP TutorialLorna Mitchell
 
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...CA API Management
 

Similar to Web Services Testing: API Testing Tools and REST-Assured Framework (20)

Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slides
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
Api testing
Api testingApi testing
Api testing
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API Documentation
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST API
 
API testing with the help of Rest Assured
API testing with the help of  Rest Assured API testing with the help of  Rest Assured
API testing with the help of Rest Assured
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - Introduction
 
Attacking REST API
Attacking REST APIAttacking REST API
Attacking REST API
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
Web API Test Automation using Frisby & Node.js
Web API Test Automation using Frisby  & Node.jsWeb API Test Automation using Frisby  & Node.js
Web API Test Automation using Frisby & Node.js
 
Web API Test Automation Using Frisby & Node.js
Web API Test Automation Using Frisby  & Node.jsWeb API Test Automation Using Frisby  & Node.js
Web API Test Automation Using Frisby & Node.js
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API Documentation
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
POSTMAN.pptx
POSTMAN.pptxPOSTMAN.pptx
POSTMAN.pptx
 
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
 
Spa Secure Coding Guide
Spa Secure Coding GuideSpa Secure Coding Guide
Spa Secure Coding Guide
 

More from DataArt

DataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human ApproachDataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human ApproachDataArt
 
DataArt Healthcare & Life Sciences
DataArt Healthcare & Life SciencesDataArt Healthcare & Life Sciences
DataArt Healthcare & Life SciencesDataArt
 
DataArt Financial Services and Capital Markets
DataArt Financial Services and Capital MarketsDataArt Financial Services and Capital Markets
DataArt Financial Services and Capital MarketsDataArt
 
About DataArt HR Partners
About DataArt HR PartnersAbout DataArt HR Partners
About DataArt HR PartnersDataArt
 
Event management в IT
Event management в ITEvent management в IT
Event management в ITDataArt
 
Digital Marketing from inside
Digital Marketing from insideDigital Marketing from inside
Digital Marketing from insideDataArt
 
What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)DataArt
 
DevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проектDevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проектDataArt
 
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArtIT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArtDataArt
 
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
 «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han... «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...DataArt
 
Communication in QA's life
Communication in QA's lifeCommunication in QA's life
Communication in QA's lifeDataArt
 
Нельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьмиНельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьмиDataArt
 
Знакомьтесь, DevOps
Знакомьтесь, DevOpsЗнакомьтесь, DevOps
Знакомьтесь, DevOpsDataArt
 
DevOps in real life
DevOps in real lifeDevOps in real life
DevOps in real lifeDataArt
 
Codeless: автоматизация тестирования
Codeless: автоматизация тестированияCodeless: автоматизация тестирования
Codeless: автоматизация тестированияDataArt
 
Selenoid
SelenoidSelenoid
SelenoidDataArt
 
Selenide
SelenideSelenide
SelenideDataArt
 
A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"DataArt
 
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...DataArt
 
IT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNGIT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNGDataArt
 

More from DataArt (20)

DataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human ApproachDataArt Custom Software Engineering with a Human Approach
DataArt Custom Software Engineering with a Human Approach
 
DataArt Healthcare & Life Sciences
DataArt Healthcare & Life SciencesDataArt Healthcare & Life Sciences
DataArt Healthcare & Life Sciences
 
DataArt Financial Services and Capital Markets
DataArt Financial Services and Capital MarketsDataArt Financial Services and Capital Markets
DataArt Financial Services and Capital Markets
 
About DataArt HR Partners
About DataArt HR PartnersAbout DataArt HR Partners
About DataArt HR Partners
 
Event management в IT
Event management в ITEvent management в IT
Event management в IT
 
Digital Marketing from inside
Digital Marketing from insideDigital Marketing from inside
Digital Marketing from inside
 
What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)What's new in Android, Igor Malytsky ( Google Post I|O Tour)
What's new in Android, Igor Malytsky ( Google Post I|O Tour)
 
DevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проектDevOps Workshop:Что бывает, когда DevOps приходит на проект
DevOps Workshop:Что бывает, когда DevOps приходит на проект
 
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArtIT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
IT Talk Kharkiv: «‎Soft skills в IT. Польза или вред? Максим Бастион, DataArt
 
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
 «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han... «Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
«Ноль копеек. Спастись от выгорания» — Сергей Чеботарев (Head of Design, Han...
 
Communication in QA's life
Communication in QA's lifeCommunication in QA's life
Communication in QA's life
 
Нельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьмиНельзя просто так взять и договориться, или как мы работали со сложными людьми
Нельзя просто так взять и договориться, или как мы работали со сложными людьми
 
Знакомьтесь, DevOps
Знакомьтесь, DevOpsЗнакомьтесь, DevOps
Знакомьтесь, DevOps
 
DevOps in real life
DevOps in real lifeDevOps in real life
DevOps in real life
 
Codeless: автоматизация тестирования
Codeless: автоматизация тестированияCodeless: автоматизация тестирования
Codeless: автоматизация тестирования
 
Selenoid
SelenoidSelenoid
Selenoid
 
Selenide
SelenideSelenide
Selenide
 
A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"
 
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
Эмоциональный интеллект или как не сойти с ума в условиях сложного и динамичн...
 
IT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNGIT talk: Как я перестал бояться и полюбил TestNG
IT talk: Как я перестал бояться и полюбил TestNG
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Web Services Testing: API Testing Tools and REST-Assured Framework

  • 1.
  • 2. Web Services Testing Natalia Rikhmayer, QA Automation Engineer, DataArt
  • 3. • Experienced in : • Web, • Web Mobile, • Mobile Native, • API • Currently work on API automation
 
 What about you? :) Lets’s get acquainted!
  • 5. Why is it important?
  • 6. Agenda ‣ What is API? ‣ Basic definitions ‣ HTTP request/response ‣ SOAP, example ‣ REST, example ‣ API testing tools ‣ REST-Assured framework ‣ Examples
  • 7. What is Application Programming Interface (API)?
  • 8. Basic definitions ‣ HTTP ‣ The most used HTTP Methods (CRUD operations) – POST - Create – GET - Read – PUT - Update/replace – DELETE - Delete ‣ Headers
  • 11. HTTP Status Codes ‣ 1XX: Informational ‣ 2XX: Success ‣ 3XX: Redirection ‣ 4XX: Client Error ‣ 5XX: Server Error ‣ There are over 70 HTTP status codes (!). ‣ Everything worked ‣ The application did something wrong ‣ The API did something wrong http://blog.restcase.com/rest-api-error-codes-101/ ➡ 200 - OK ➡ 400 - Bad Request ➡ 500 - Internal Server Error Everything is going to be 200 OK :)
  • 12. HTTP Status Code Description ‣ 200 OK - Response to a successful REST API action ‣ 400 Bad Request - The request is malformed, such as message body format error ‣ 401 Unauthorized - Wrong or no authentication ID/password provided ‣ 403 Forbidden - It's used when the authentication succeeded but authenticated user doesn't have permission to the request resource ‣ 404 Not Found - When a non-existent resource is requested ‣ 405 Method Not Allowed - The error checking for unexpected HTTP method. For example, the RestAPI is expecting HTTP GET, but HTTP PUT is used ‣ 429 Too Many Requests - The error is used when there may be DOS attack detected or the request is rejected due to rate limiting
  • 13. Representational State Transfer (REST) ‣RESTful applications use HTTP methods ‣data available as resources (nouns), I.e. “user” ‣hard to enforce authorization and security on top of it ‣relatively easy to implement and maintain ‣clearly separates client and server implementations ‣can return data in multiple formats (JSON, XML etc) ‣Scalability, maintainability ‣Demo https://dzone.com/articles/j2ee-compare-restful-vs-soap https://habrahabr.ru/post/131343/ https://nordicapis.com/rest-vs-soap-nordic-apis-infographic-comparison/ ‣ Examples Slack API LinkedIn API Twitter API
  • 14. Simple Object Access Protocol (SOAP) ‣data available as services (verb+noun), I.e. “getUser” ‣follows a formal enterprise approach (its a standard) ‣works on top of any communication protocol ‣security and authorization are part of the protocol ‣can be fully described using WSDL (e.g. put your WSDL url to generate Java/Objective-C/Swift classes http://easywsdl.com/WsdlGenerator#) ‣hard to implement and is unpopular among Web and mobile developers ‣uses only XML https://dzone.com/articles/j2ee-compare-restful-vs-soap https://habrahabr.ru/post/131343/ https://nordicapis.com/rest-vs-soap-nordic-apis-infographic-comparison/ ‣ Examples Salesforce SOAP API Paypal SOAP API Clickatell SMS SOAP API
  • 15. Common types of API testing • Verify API Response Code • Based on input request, response should be checked • Verification of the updating some data structure • Delays in API Response time • Response Data structure • Security testing
  • 16. Useful Tools Rest assured - Java, RestSharp - C# Airborne - Ruby, Apickli - JS Retrofit - Android/JAVA… and other
  • 17. Rest-assured @Test(groups = {APIConfig.login_ID}) public void login() { Logger.info("Verify login"); String loginURL = getModifiedURI(LOGIN_URI, "v1"); String token = given() .contentType(ContentType.JSON) .body("{n" + " "UserId": " + userId + ",n" + " "Email": "" + email + "",n" + " "ScreenName": "" + screenName + ""n" + "}") .when() .post(loginURL) .then() .assertThat() .statusCode(HttpURLConnection.HTTP_OK) .extract() .path(AUTH_TOKEN_KEY); assertFalse(token.isEmpty(), "User Token should not be empty"); } <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>3.0.0</version> </dependency>
  • 18. To automate or not to automate on API level? ‣ Login ‣ Registration ‣ Join/leave group ‣ Ban/unban for 30 min ‣ Confirmation via email ‣ Subscription ‣ Navigation ‣ Article verification
  • 19. Challenges of API testing ‣ Parameter Combination ‣ Parameter Selection ‣ Call Sequencing ‣ Frequent releases ‣ Delays in logging ‣ Support of auto-tests ‣ Data is changed
  • 20. Advantages of API testing ‣ Access to the application without a user interface ‣ Time effective, especially automated tests ‣ Cost effective, accordingly ‣ Language-independent ‣ Test Core Functionality, once for several clients Project examples
  • 21. Thank you! Any questions? Any further questions? Natalia.Bilogrud@dataart.com