SlideShare a Scribd company logo
1
Automation of web service
testing for the beginners
FEBRYARY 26, 2017
2
Andrei Stasevich
Experience
• M.Sc. of engineering with more then 5 years
experience
• Main IT specialization: Test Automation
• Technology: Java, Selenium
• COMAQA.by community activistAndrei Stasevich
EPAM Systems
Software Test Automation
Engineer
3
AGENDA
Introduction to API1
What is web service2
SOAP and REST5
Examples6
Ways of communication3
Web Service testing4
4
INTRODUCTION TO API
Application programming interface (API) - a set of clearly defined methods of
communication between various software components.
• Web service
• Libraries
• Operation system API
• Graphical/sound interfaces
5
API is like User Interface - just with different users in mind.
INTRODUCTION TO API
6
AGENDA
Introduction to API1
What is web service2
SOAP and REST5
Examples6
Ways of communication3
Web Service testing4
7
WHAT IS WEB SERVICE?
Web service - software system designed to support interoperable machine-
to-machine interaction over a network.
• It accessible over the Internet or private networks.
• Is not tied to any one operating system or programming language.
• Used for direct application-to-application interaction.
• Uses XML (JSON) messages for interaction.
Every Web Service is an API but not every API is a Web Service
8
WHAT IS WEB SERVICE?
• The client bundles the information into a message (request).
• Client and server establish connection and sent message as the body of an
HTTP request.
• Service processes the received information.
• Service packages the response, and sends it back to the client program.
• The client program unpacks the request to obtain the result.
9
WHAT IS WEB SERVICE?
• Establishing TCP connection.
• Client sends version of the TLS protocol, the list
of supported ciphersuites, and other TLS
options.
• The server picks the TLS protocol version,
decides on a ciphersuite, attaches its
certificate.
• The client initiates key exchange, which is used
to establish the symmetric key.
• The server returns an
encrypted Finished message back to the client.
• The client decrypts the message and if all is
well, then the tunnel is established.
10
WHAT IS WEB SERVICE?
center=NY
zoom=13
size=640x640
maptype=road
GET https://maps.googleapis.com/maps/api/staticmap?
center=NY&zoom=13&size=640x640&maptype=roadmap
&key=AIzaSyDH7iC
center
zoom
size
maptype
key
…
HTTP/1.1 200 OK
Content-Type: image/png
11
AGENDA
Introduction to API1
What is web service2
SOAP and REST5
Examples6
Ways of communication3
Web Service testing4
12
WAYS OF COMMUNICATION
XML is a markup language that defines a set of rules
for encoding documents in a format that is both
human-readable and machine-readable. XML is
a language-independent data format.
JSON is an open-standard format that uses human-
readable text to transmit data objects consisting
of attribute–value pairs. JSON is a language-
independent data format.
13
WAYS OF COMMUNICATION
XML (Extensible Markup Language) is a markup language that defines a set
of rules for encoding documents in a format that is both human-readable and
machine-readable.
XML was designed to describe data
XML is about carrying information – within TAGs
Tags are not predefined – make your own ones
XML document does not DO anything so to say
• It is just information wrapped in tags
• Custom code needed for interpretation
XML is a software - and hardware-independent tool
• Used to store and transport information
14
WAYS OF COMMUNICATION
An XML element can contain:
• Other elements
• Any given text
• Attributes
• Mix of the previouos
Comments may appear anywhere
• An example of a valid comment: <!–- the comment itself -->
15
WAYS OF COMMUNICATION
JSON is an open-standard format that uses human-readable text to transmit data objects
consisting of attribute–value pairs. JSON is a language-independent data format.
JSON is a syntax for storing and exchanging data
• An easier-to-use alternative to XML
The JSON format is well fitted for Java and JavaScript
• Very lightweight
• Easy to process for services
16
WAYS OF COMMUNICATION
JSON's basic data types are:
• Number
• String
• Boolean
• Array
• Object
• null
• Square brackets hold arrays
JSON syntax is a subset of the JavaScript syntax:
• Data is in
„name:value” pairs
• Data is separated by commas
• Curly braces hold objects
• Interestingly, there are no comments in JSON
17
18
AGENDA
Introduction to API1
What is web service2
SOAP and REST5
Examples6
Ways of communication3
Web Service testing4
19
WEB SERVICE TESTING
Happy paths
• Using the provided method calls
• Analyzing the returned data
• Trying out different parameters
• Response validation
20
Web Service testing
Unhappy paths
• Using wrong URIs
• Invalid or missing parameters
• See how the server responds to those
• Client or server side errors
21
AGENDA
Introduction to API1
What is web service2
SOAP and REST5
Examples6
Ways of communication3
Web Service testing4
22
SOAP
SOAP (Simple Object Access Protocol) is a protocol specification for exchanging structured
information in XML format.
SOA web-services:
• Service provider: creates a web service and provides its information to the service broker.
• Service broker UDDI: makes the information regarding the web service available to any
potential requester.
• Service requester: locates entries in the broker registry using various find
operations and then binds to the service provider
in order to invoke one of its web services.
Rules for communication are defined in WSDL file
(Web Services Description Language):
• How one system can request data from another system.
• Specific parameters.
• The structure of the data.
• Error messages.
23
WSDL
<binding> - поддерживаемые протоколы.
<message> - сообщения Web-службы (запрос, ответ).
<portType> — все доступные методы.
<service> — URI службы.
<types> — используемые типы данных.
24
SOAP
SOAP provides the envelope for sending Web Services messages over
the HTTP/SMTP.
The SOAP envelope contains two parts:
• SOAP Header (optional): providing information on authentication,
encoding of data, or how a recipient of a SOAP message should process the
message.
• SOAP Body: contains the message. These messages can be defined using
the WSDL specification.
25
SOAP
26
REST
Representational State Transfer (REST) is a style of architecture
based on a set of principles that describe how networked resources are
defined and addressed.
• Client-Server
• Stateless
• Cacheable
• Layered system
• Code on demand
• Uniform interface
27
REST
REST-compliant Web services allow requesting systems to access and manipulate
textual representations of Web resources using a uniform and predefined set of stateless
operations. "Web resources" were first defined as documents or files identified by
their URLs.
POST http://www.example.com/customers
GET http://www.example.com/customers/33245
DELETE http://www.example.com/customers/33245
PUT http://www.example.com/customers/33245
28
AGENDA
Introduction to API1
What is web service2
SOAP and REST5
Examples6
Ways of communication3
Web Service testing4
29
Test
• Test NG, Junit, RestAssured
Service
• Java
HTTP client
• Apache, Retrofit
TEST FRAMEWORK
Test
Service
Layer
HTTP
client
30
TEST
31
SERVISE
32
HTTP CLIENT
33
TEST
34
THANK
YOU
35
CONTACT ME
Andrei_Stasevich@epam.com
Andrei.Stasevich@gmail.com
https://www.linkedin.com/in/andrei-stasevich/

More Related Content

PPTX
Web services SOAP
PPTX
An Overview of Web Services: SOAP and REST
PDF
Web services
PPTX
WebServices
PPTX
Introduction to web services
PPTX
Simple object access protocol(soap )
PPTX
Soap web service
PPT
WebServices SOAP WSDL and UDDI
Web services SOAP
An Overview of Web Services: SOAP and REST
Web services
WebServices
Introduction to web services
Simple object access protocol(soap )
Soap web service
WebServices SOAP WSDL and UDDI

What's hot (20)

PDF
Web service introduction
PPTX
SOA standards
PPT
Java web services
PPTX
SOAP--Simple Object Access Protocol
PDF
Understanding SOAP and REST basics and differences
PPTX
Simple Object Access Protocol (SOAP)
PDF
Java Web Services [1/5]: Introduction to Web Services
PDF
Web Services
PDF
SOAP vs REST
PPTX
Web Services - A brief overview
PPTX
Web services soap and rest by mandakini for TechGig
PPT
SOAP:Simple Object Access Protocol -XML-RPC
PPTX
Rest webservice ppt
PPTX
Web Service
PDF
Introduction to SOAP/WSDL Web Services and RESTful Web Services
PPT
HTTP protocol and Streams Security
PDF
Web Services Tutorial
PPTX
Json web tokens
PPTX
introduction for web connectivity (IoT)
Web service introduction
SOA standards
Java web services
SOAP--Simple Object Access Protocol
Understanding SOAP and REST basics and differences
Simple Object Access Protocol (SOAP)
Java Web Services [1/5]: Introduction to Web Services
Web Services
SOAP vs REST
Web Services - A brief overview
Web services soap and rest by mandakini for TechGig
SOAP:Simple Object Access Protocol -XML-RPC
Rest webservice ppt
Web Service
Introduction to SOAP/WSDL Web Services and RESTful Web Services
HTTP protocol and Streams Security
Web Services Tutorial
Json web tokens
introduction for web connectivity (IoT)
Ad

Viewers also liked (20)

PPTX
Логические инструменты в арсенале тестировщика
PPT
Процесс тестирования в условиях неявных требований
PPTX
А давайте будем многопоточить и масштабировить! - записки сумасшедшего №0
PDF
Некоторые физические законы в контексте автоматизации тестирования
PPTX
В топку Postman - пишем API автотесты в привычном стеке
PPTX
тестовые стратегии
PPTX
Future of UI Automation testing and JDI
PPTX
Career boost: как джуниору случайно стать лидом и не получить от этого удовол...
PDF
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
PPTX
карта IT профессий
PPTX
Refresh your project vision with Report Portal
PPTX
низкоуровневое программирование сегодня новые стандарты с++, программирован...
PPTX
Business requirements analysis during Production release
PDF
Heuristics, mnemonics and other Greek words in the exploratory testing of mob...
PPTX
Parallel run selenium tests in a good way
PPTX
Роман Сорока
PDF
Английский для программиста
PPTX
многогранная профессия тестировщика глазами с++ разработчика в примерах
PPSX
Trishweb
PPTX
ScreenPlay Design Patterns for QA Automation
Логические инструменты в арсенале тестировщика
Процесс тестирования в условиях неявных требований
А давайте будем многопоточить и масштабировить! - записки сумасшедшего №0
Некоторые физические законы в контексте автоматизации тестирования
В топку Postman - пишем API автотесты в привычном стеке
тестовые стратегии
Future of UI Automation testing and JDI
Career boost: как джуниору случайно стать лидом и не получить от этого удовол...
Тестирование мобильных приложений используя облачные сервисы. TestDroid, Test...
карта IT профессий
Refresh your project vision with Report Portal
низкоуровневое программирование сегодня новые стандарты с++, программирован...
Business requirements analysis during Production release
Heuristics, mnemonics and other Greek words in the exploratory testing of mob...
Parallel run selenium tests in a good way
Роман Сорока
Английский для программиста
многогранная профессия тестировщика глазами с++ разработчика в примерах
Trishweb
ScreenPlay Design Patterns for QA Automation
Ad

Similar to Автоматизация тестирования API для начинающих (20)

PPTX
Web Service Testing By Sheshadri Mishra
PPTX
Web services
PPTX
Web-services-MD.pptx for web site designing
PDF
Api Penetration Testing and web app pentesting
PPTX
Web services for banks
PPTX
PPTX
unit -4 spring web services like SOA Arch
PPT
complete web service1.ppt
PDF
Week2 cloud computing week2
PPTX
nptl cc video.pptx
PPTX
Soap and restful webservice
PPTX
Web services
PPT
Rest introduction
PPTX
Introduction to APIs (Application Programming Interface)
PPT
Introduction of WebServices
ODP
Web service Introduction
PPT
java-webservices introduction ppt for beginners
PPT
CS-802 Act-1.ppt
PPT
Introduction to REST
Web Service Testing By Sheshadri Mishra
Web services
Web-services-MD.pptx for web site designing
Api Penetration Testing and web app pentesting
Web services for banks
unit -4 spring web services like SOA Arch
complete web service1.ppt
Week2 cloud computing week2
nptl cc video.pptx
Soap and restful webservice
Web services
Rest introduction
Introduction to APIs (Application Programming Interface)
Introduction of WebServices
Web service Introduction
java-webservices introduction ppt for beginners
CS-802 Act-1.ppt
Introduction to REST

More from COMAQA.BY (20)

PDF
Тестирование аналогов инсталлируемых приложений (Android Instant Apps, Progre...
PPTX
Anton semenchenko. Comaqa Spring 2018. Nine circles of hell. Antipatterns in ...
PPTX
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
PPTX
Roman Soroka. Comaqa Spring 2018. Глобальный обзор процесса QA и его важность
PPTX
Roman Iovlev. Comaqa Spring 2018. Архитектура Open Source решений для автомат...
PPTX
Vladimir Polyakov. Comaqa Spring 2018. Особенности тестирования ПО в предметн...
PPTX
Kimmo Hakala. Comaqa Spring 2018. Challenges and good QA practices in softwar...
PPTX
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
PPTX
Ivan Katunov. Comaqa Spring 2018. Test Design and Automation for Rest API.
PPTX
Vadim Zubovich. Comaqa Spring 2018. Красивое тестирование производительности.
PPTX
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
PPTX
Моя роль в конфликте
PPTX
Организация приемочного тестирования силами матерых тестировщиков
PPTX
Развитие или смерть
PPTX
Системный взгляд на параллельный запуск Selenium тестов
PPTX
Эффективная работа с рутинными задачами
PPTX
Как стать синьором
PPTX
Open your mind for OpenSource
PPTX
JDI 2.0. Not only UI testing
PPTX
Out of box page object design pattern, java
Тестирование аналогов инсталлируемых приложений (Android Instant Apps, Progre...
Anton semenchenko. Comaqa Spring 2018. Nine circles of hell. Antipatterns in ...
Vivien Ibironke Ibiyemi. Comaqa Spring 2018. Enhance your Testing Skills With...
Roman Soroka. Comaqa Spring 2018. Глобальный обзор процесса QA и его важность
Roman Iovlev. Comaqa Spring 2018. Архитектура Open Source решений для автомат...
Vladimir Polyakov. Comaqa Spring 2018. Особенности тестирования ПО в предметн...
Kimmo Hakala. Comaqa Spring 2018. Challenges and good QA practices in softwar...
Дмитрий Лемешко. Comaqa Spring 2018. Continuous mobile automation in build pi...
Ivan Katunov. Comaqa Spring 2018. Test Design and Automation for Rest API.
Vadim Zubovich. Comaqa Spring 2018. Красивое тестирование производительности.
Alexander Andelkovic. Comaqa Spring 2018. Using Artificial Intelligence to Te...
Моя роль в конфликте
Организация приемочного тестирования силами матерых тестировщиков
Развитие или смерть
Системный взгляд на параллельный запуск Selenium тестов
Эффективная работа с рутинными задачами
Как стать синьором
Open your mind for OpenSource
JDI 2.0. Not only UI testing
Out of box page object design pattern, java

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
KodekX | Application Modernization Development
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
Digital-Transformation-Roadmap-for-Companies.pptx
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Spectral efficient network and resource selection model in 5G networks
KodekX | Application Modernization Development
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Building Integrated photovoltaic BIPV_UPV.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction

Автоматизация тестирования API для начинающих

  • 1. 1 Automation of web service testing for the beginners FEBRYARY 26, 2017
  • 2. 2 Andrei Stasevich Experience • M.Sc. of engineering with more then 5 years experience • Main IT specialization: Test Automation • Technology: Java, Selenium • COMAQA.by community activistAndrei Stasevich EPAM Systems Software Test Automation Engineer
  • 3. 3 AGENDA Introduction to API1 What is web service2 SOAP and REST5 Examples6 Ways of communication3 Web Service testing4
  • 4. 4 INTRODUCTION TO API Application programming interface (API) - a set of clearly defined methods of communication between various software components. • Web service • Libraries • Operation system API • Graphical/sound interfaces
  • 5. 5 API is like User Interface - just with different users in mind. INTRODUCTION TO API
  • 6. 6 AGENDA Introduction to API1 What is web service2 SOAP and REST5 Examples6 Ways of communication3 Web Service testing4
  • 7. 7 WHAT IS WEB SERVICE? Web service - software system designed to support interoperable machine- to-machine interaction over a network. • It accessible over the Internet or private networks. • Is not tied to any one operating system or programming language. • Used for direct application-to-application interaction. • Uses XML (JSON) messages for interaction. Every Web Service is an API but not every API is a Web Service
  • 8. 8 WHAT IS WEB SERVICE? • The client bundles the information into a message (request). • Client and server establish connection and sent message as the body of an HTTP request. • Service processes the received information. • Service packages the response, and sends it back to the client program. • The client program unpacks the request to obtain the result.
  • 9. 9 WHAT IS WEB SERVICE? • Establishing TCP connection. • Client sends version of the TLS protocol, the list of supported ciphersuites, and other TLS options. • The server picks the TLS protocol version, decides on a ciphersuite, attaches its certificate. • The client initiates key exchange, which is used to establish the symmetric key. • The server returns an encrypted Finished message back to the client. • The client decrypts the message and if all is well, then the tunnel is established.
  • 10. 10 WHAT IS WEB SERVICE? center=NY zoom=13 size=640x640 maptype=road GET https://maps.googleapis.com/maps/api/staticmap? center=NY&zoom=13&size=640x640&maptype=roadmap &key=AIzaSyDH7iC center zoom size maptype key … HTTP/1.1 200 OK Content-Type: image/png
  • 11. 11 AGENDA Introduction to API1 What is web service2 SOAP and REST5 Examples6 Ways of communication3 Web Service testing4
  • 12. 12 WAYS OF COMMUNICATION XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. XML is a language-independent data format. JSON is an open-standard format that uses human- readable text to transmit data objects consisting of attribute–value pairs. JSON is a language- independent data format.
  • 13. 13 WAYS OF COMMUNICATION XML (Extensible Markup Language) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. XML was designed to describe data XML is about carrying information – within TAGs Tags are not predefined – make your own ones XML document does not DO anything so to say • It is just information wrapped in tags • Custom code needed for interpretation XML is a software - and hardware-independent tool • Used to store and transport information
  • 14. 14 WAYS OF COMMUNICATION An XML element can contain: • Other elements • Any given text • Attributes • Mix of the previouos Comments may appear anywhere • An example of a valid comment: <!–- the comment itself -->
  • 15. 15 WAYS OF COMMUNICATION JSON is an open-standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. JSON is a language-independent data format. JSON is a syntax for storing and exchanging data • An easier-to-use alternative to XML The JSON format is well fitted for Java and JavaScript • Very lightweight • Easy to process for services
  • 16. 16 WAYS OF COMMUNICATION JSON's basic data types are: • Number • String • Boolean • Array • Object • null • Square brackets hold arrays JSON syntax is a subset of the JavaScript syntax: • Data is in „name:value” pairs • Data is separated by commas • Curly braces hold objects • Interestingly, there are no comments in JSON
  • 17. 17
  • 18. 18 AGENDA Introduction to API1 What is web service2 SOAP and REST5 Examples6 Ways of communication3 Web Service testing4
  • 19. 19 WEB SERVICE TESTING Happy paths • Using the provided method calls • Analyzing the returned data • Trying out different parameters • Response validation
  • 20. 20 Web Service testing Unhappy paths • Using wrong URIs • Invalid or missing parameters • See how the server responds to those • Client or server side errors
  • 21. 21 AGENDA Introduction to API1 What is web service2 SOAP and REST5 Examples6 Ways of communication3 Web Service testing4
  • 22. 22 SOAP SOAP (Simple Object Access Protocol) is a protocol specification for exchanging structured information in XML format. SOA web-services: • Service provider: creates a web service and provides its information to the service broker. • Service broker UDDI: makes the information regarding the web service available to any potential requester. • Service requester: locates entries in the broker registry using various find operations and then binds to the service provider in order to invoke one of its web services. Rules for communication are defined in WSDL file (Web Services Description Language): • How one system can request data from another system. • Specific parameters. • The structure of the data. • Error messages.
  • 23. 23 WSDL <binding> - поддерживаемые протоколы. <message> - сообщения Web-службы (запрос, ответ). <portType> — все доступные методы. <service> — URI службы. <types> — используемые типы данных.
  • 24. 24 SOAP SOAP provides the envelope for sending Web Services messages over the HTTP/SMTP. The SOAP envelope contains two parts: • SOAP Header (optional): providing information on authentication, encoding of data, or how a recipient of a SOAP message should process the message. • SOAP Body: contains the message. These messages can be defined using the WSDL specification.
  • 26. 26 REST Representational State Transfer (REST) is a style of architecture based on a set of principles that describe how networked resources are defined and addressed. • Client-Server • Stateless • Cacheable • Layered system • Code on demand • Uniform interface
  • 27. 27 REST REST-compliant Web services allow requesting systems to access and manipulate textual representations of Web resources using a uniform and predefined set of stateless operations. "Web resources" were first defined as documents or files identified by their URLs. POST http://www.example.com/customers GET http://www.example.com/customers/33245 DELETE http://www.example.com/customers/33245 PUT http://www.example.com/customers/33245
  • 28. 28 AGENDA Introduction to API1 What is web service2 SOAP and REST5 Examples6 Ways of communication3 Web Service testing4
  • 29. 29 Test • Test NG, Junit, RestAssured Service • Java HTTP client • Apache, Retrofit TEST FRAMEWORK Test Service Layer HTTP client