SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Testing REST Web Services
Testing REST Web ServicesTesting REST Web Services
Testing REST Web Services
Jan Algermissen
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
Lorna Mitchell
 
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
Harry Potter
 

Was ist angesagt? (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
 

Ähnlich wie Web Services Testing

REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
Jeelani Shaik
 

Ähnlich wie Web Services Testing (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
 

Mehr von DataArt

Digital Marketing from inside
Digital Marketing from insideDigital Marketing from inside
Digital Marketing from inside
DataArt
 
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
 

Mehr von 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
 

Kürzlich hochgeladen

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Kürzlich hochgeladen (20)

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 

Web Services Testing

  • 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