SlideShare a Scribd company logo
WEB API TEST AUTOMATION
FRISBY – NODE.JS
Bao Nguyen – Quang To
SHIFT ASIA
Agenda
• Introduction
• This session discusses:
– Web API Test
– Frisby
– A case study from SHIFT ASIA
• Technology discussed:
– Node.js
– REST APIs with JSON
• Code download available at:
– https://bitbucket.org/ShiftAsia/api_test
2
Bao Nguyen
• R&D Manager at SHIFT ASIA
• Full-stack developer
Quang To
• Test Engineer at SHIFT ASIA
• Experience in various aspects
of Testing
3
Introduction
Objectives
Upon completion of the meetup, audiences
should be able to:
• Understand Web APIs
• Differentiate SOAP from REST Web APIs
• Learn well-known API Test tools
• Develop API Test Automation using Frisby and
Node.js
4
5
Web API Test
API – Overview
6
API – Overview
7
API
Web Service
SOAP REST
SOAP
• Simple Object Access
Protocol
• Standardized protocol
• Rely heavily on XML
• Use WSDL (Web Service
Definition Language) as a
contract between the
provider and the consumer
of the service
REST
• REpresentational State
Transfer
• Architectural style
• JSON is preferred
• Use HTTP standard verbs,
such as: GET, POST, PUT,
DELETE
8
SOAP vs. REST
Why API Test?
• System complexity increased
Multi-tiered model with private APIs making
up the middleware
• A huge demand of public APIs
• Getting feedback as soon as possible
9
API – Hierarchy of Needs
10
apiux.com
Web REST API Call
11
1
Request
Url + Verb
2
Respons
e
Status code + Header + Body
http://swapi.co/api/people/1/
allow →GET, HEAD, OPTIONS
content-type →application/json
vary →Accept
{
"name": "Luke Skywalker",
“height": "172",
“mass": “77",
“hair_color": “blond“,
…
}
HTTP status →200 OK
Web API Test Checkpoints
• Status code
• Returned value
• Schema
• Response time
12
API Test Tools
• Scriptless tools
13
• Scripting tools/frameworks
14
Frisby
Frisby – Overview
• REST API testing framework built on Node.js
• Simple
• Fast
• Continuous Integration
• http://frisbyjs.com/
• npm install --save-dev frisby
15
API Verbs
16
HTTP Verb CRUD
Entire Collection
(e.g. /users)
Specific Item
(e.g. /users/{id})
POST Create 201 (Created) 404 (Not Found), 409 (Conflict) if
resource already exists.
GET Read 200 (OK) 200 (OK), single user. 404 (Not
Found), if ID not found or invalid.
PUT Update/Replace 404 (Not Found) 200 (OK) or 204 (No Content). 404
(Not Found), if ID not found or
invalid.
PATCH Update/Modify 404 (Not Found) 200 (OK) or 204 (No Content). 404
(Not Found), if ID not found or
invalid.
DELETE Delete 404 (Not Found) 200 (OK). 404 (Not Found), if ID not
found or invalid.
Frisby – Methods
• HTTP methods
– Post()
– Get()
– Put()
– Patch()
– Delete()
17
Frisby – Methods
• Expectations
– expectStatus()
– expectHeader()
– expectHeaderContains()
– expectHeaderToMatch()
– expectJSON()
– expectBodyContains()
– expectJSONTypes()
– expectJSONLength()
– expectMaxResponseTime(
)
18
Status code
Returned value
Returned value
Returned value
Returned value
Returned value
Schema
Schema
Response time
Frisby – Demo
• POST
• GET
• PUT
• DELETE
19
Frisby – Challenges
• Documentation
Lack of more detailed examples
• Poor debugging info
20
Frisby – Challenges
• Asynchronous
• Demo
21
Test API 1 API 2
Request 1
Response 1
Request 2
Response 2
Response values
transferred
Frisby – Challenges
• Solution = Callback
• Demo
22
Frisby – Challenges
• Another concern with Callback
• Demo
23
Frisby – Challenges
24
Frisby – Challenges
• Solution = async
• npm install --save async
• Demo
25
26
A Case Study from SHIFT ASIA
SHIFT ASIA – Methodology
27
Requirements User Stories
Test Cases
Test Scripts
Test Designer
Test Engineer
Tester
Tester
#AutomateBuild
#AutomateTestExecution
#AutomateReporting
SHIFT ASIA – Case Study
28
TEST SCRIPT
Tester
#TestDevelopment
SCRIPT GENERATION
Test Engineer
#Utility
#Helpers
HARD-CORE
Test Architect
#StandardStructure
#NamingConvention
#Settings
#Modules Node.js
FrisbyJasmine-node
shelljs
Helper modules
Test in Yaml Data in Yaml
Yaml to JSON files
Run API tests
SHIFT ASIA – Case Study
29
Yaml to JSON
JSON to Spec
Run
Tester
© 2014 HCMC Software Testing Club
THANK YOU
Ad

More Related Content

What's hot (20)

Super powered API testing
Super powered API testing Super powered API testing
Super powered API testing
postmanclient
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
Sauce Labs
 
Presentation for soap ui
Presentation for soap uiPresentation for soap ui
Presentation for soap ui
Anjali Rao
 
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
 
Automated tests to a REST API
Automated tests to a REST APIAutomated tests to a REST API
Automated tests to a REST API
Luís Barros Nóbrega
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
Bruno Pedro
 
Automated API pentesting using fuzzapi
Automated API pentesting using fuzzapiAutomated API pentesting using fuzzapi
Automated API pentesting using fuzzapi
Abhijeth D
 
Ppt of soap ui
Ppt of soap uiPpt of soap ui
Ppt of soap ui
pkslide28
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
Fachrul Choliluddin
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
Peter Thomas
 
API Testing with Open Source Code and Cucumber
API Testing with Open Source Code and CucumberAPI Testing with Open Source Code and Cucumber
API Testing with Open Source Code and Cucumber
SmartBear
 
Automate REST API Testing
Automate REST API TestingAutomate REST API Testing
Automate REST API Testing
TechWell
 
API Prefetching - HTML5DevConf - Oct. 21, 2014
API Prefetching - HTML5DevConf - Oct. 21, 2014API Prefetching - HTML5DevConf - Oct. 21, 2014
API Prefetching - HTML5DevConf - Oct. 21, 2014
JonAbrams
 
Rest API Testing
Rest API TestingRest API Testing
Rest API Testing
upadhyay_25
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 
Test driven APIs with Laravel
Test driven APIs with LaravelTest driven APIs with Laravel
Test driven APIs with Laravel
Michael Peacock
 
2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured
Eing Ong
 
Frisby Api automation
Frisby Api automationFrisby Api automation
Frisby Api automation
Dineesha Suraweera
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
Sauce Labs
 
API Testing
API TestingAPI Testing
API Testing
Bikash Sharma
 
Super powered API testing
Super powered API testing Super powered API testing
Super powered API testing
postmanclient
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
Sauce Labs
 
Presentation for soap ui
Presentation for soap uiPresentation for soap ui
Presentation for soap ui
Anjali Rao
 
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
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
Bruno Pedro
 
Automated API pentesting using fuzzapi
Automated API pentesting using fuzzapiAutomated API pentesting using fuzzapi
Automated API pentesting using fuzzapi
Abhijeth D
 
Ppt of soap ui
Ppt of soap uiPpt of soap ui
Ppt of soap ui
pkslide28
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
Peter Thomas
 
API Testing with Open Source Code and Cucumber
API Testing with Open Source Code and CucumberAPI Testing with Open Source Code and Cucumber
API Testing with Open Source Code and Cucumber
SmartBear
 
Automate REST API Testing
Automate REST API TestingAutomate REST API Testing
Automate REST API Testing
TechWell
 
API Prefetching - HTML5DevConf - Oct. 21, 2014
API Prefetching - HTML5DevConf - Oct. 21, 2014API Prefetching - HTML5DevConf - Oct. 21, 2014
API Prefetching - HTML5DevConf - Oct. 21, 2014
JonAbrams
 
Rest API Testing
Rest API TestingRest API Testing
Rest API Testing
upadhyay_25
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 
Test driven APIs with Laravel
Test driven APIs with LaravelTest driven APIs with Laravel
Test driven APIs with Laravel
Michael Peacock
 
2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured2015-StarWest presentation on REST-assured
2015-StarWest presentation on REST-assured
Eing Ong
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
Sauce Labs
 

Viewers also liked (20)

Common Web UI Problems Transforming Manual to Automation
Common Web UI Problems Transforming Manual to Automation Common Web UI Problems Transforming Manual to Automation
Common Web UI Problems Transforming Manual to Automation
Ho Chi Minh City Software Testing Club
 
Security testing-What can we do - Trinh Minh Hien
Security testing-What can we do - Trinh Minh HienSecurity testing-What can we do - Trinh Minh Hien
Security testing-What can we do - Trinh Minh Hien
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
Ho Chi Minh City Software Testing Club
 
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Practical Experiences In Test Automation
[HCMC STC Jan 2015] Practical Experiences In Test Automation[HCMC STC Jan 2015] Practical Experiences In Test Automation
[HCMC STC Jan 2015] Practical Experiences In Test Automation
Ho Chi Minh City Software Testing Club
 
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
Ho Chi Minh City Software Testing Club
 
Agile Testing - Not Just Tester’s Story _ Dang Thanh Long
Agile Testing - Not Just Tester’s Story _ Dang Thanh LongAgile Testing - Not Just Tester’s Story _ Dang Thanh Long
Agile Testing - Not Just Tester’s Story _ Dang Thanh Long
Ho Chi Minh City Software Testing Club
 
Building an effective mobile testing strategy
Building an effective mobile testing strategyBuilding an effective mobile testing strategy
Building an effective mobile testing strategy
Ho Chi Minh City Software Testing Club
 
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
Ho Chi Minh City Software Testing Club
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
Ho Chi Minh City Software Testing Club
 
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang MinhTest Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Ho Chi Minh City Software Testing Club
 
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy TamAnalytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
Ho Chi Minh City Software Testing Club
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Ho Chi Minh City Software Testing Club
 
Mobile Video Games Testing Principles - Benjamin Poirrier
Mobile Video Games Testing Principles - Benjamin PoirrierMobile Video Games Testing Principles - Benjamin Poirrier
Mobile Video Games Testing Principles - Benjamin Poirrier
Ho Chi Minh City Software Testing Club
 
Why a Mobile Test Strategy is just Test Strategy
Why a Mobile Test Strategy is just Test StrategyWhy a Mobile Test Strategy is just Test Strategy
Why a Mobile Test Strategy is just Test Strategy
Ho Chi Minh City Software Testing Club
 
Key Factors To Ensure Test Automation Framework Success
Key Factors To Ensure Test Automation Framework SuccessKey Factors To Ensure Test Automation Framework Success
Key Factors To Ensure Test Automation Framework Success
Ho Chi Minh City Software Testing Club
 
Pyunit
PyunitPyunit
Pyunit
Ikuru Kanuma
 
Python Unit Test
Python Unit TestPython Unit Test
Python Unit Test
David Xie
 
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
Ho Chi Minh City Software Testing Club
 
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Ho Chi Minh City Software Testing Club
 
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
Ho Chi Minh City Software Testing Club
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
Ho Chi Minh City Software Testing Club
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Ho Chi Minh City Software Testing Club
 
Python Unit Test
Python Unit TestPython Unit Test
Python Unit Test
David Xie
 
Ad

Similar to Web API Test Automation Using Frisby & Node.js (20)

Restful design at work v2.0
Restful design at work v2.0Restful design at work v2.0
Restful design at work v2.0
Boulder Java User's Group
 
rest3d Web3D 2014
rest3d Web3D 2014rest3d Web3D 2014
rest3d Web3D 2014
Remi Arnaud
 
Web Services Testing
Web Services TestingWeb Services Testing
Web Services Testing
DataArt
 
Developing Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonDeveloping Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & Python
SmartBear
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016
Ortus Solutions, Corp
 
Rest ful tools for lazy experts
Rest ful tools for lazy expertsRest ful tools for lazy experts
Rest ful tools for lazy experts
ColdFusionConference
 
So you think you know REST - DPC11
So you think you know REST - DPC11So you think you know REST - DPC11
So you think you know REST - DPC11
Evert Pot
 
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML ResourcesOpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Alliance
 
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
 
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotionAPIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
javier ramirez
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful Approach
Mushfekur Rahman
 
BOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT HyderabadBOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT Hyderabad
Saurabh Sahni
 
Introduction to Retrofit
Introduction to RetrofitIntroduction to Retrofit
Introduction to Retrofit
Kazuhiro Serizawa
 
PHP Server side restful API - linkedin
PHP Server side restful API - linkedinPHP Server side restful API - linkedin
PHP Server side restful API - linkedin
Vũ Quang Sơn
 
BOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT BangaloreBOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT Bangalore
Saurabh Sahni
 
Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slides
Cisco DevNet
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIs
Siva Arunachalam
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
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
Rasan Samarasinghe
 
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
Dinis Cruz
 
rest3d Web3D 2014
rest3d Web3D 2014rest3d Web3D 2014
rest3d Web3D 2014
Remi Arnaud
 
Web Services Testing
Web Services TestingWeb Services Testing
Web Services Testing
DataArt
 
Developing Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonDeveloping Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & Python
SmartBear
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016
Ortus Solutions, Corp
 
So you think you know REST - DPC11
So you think you know REST - DPC11So you think you know REST - DPC11
So you think you know REST - DPC11
Evert Pot
 
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML ResourcesOpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Advisory Forum 2012 REST XML Resources
OpenTravel Alliance
 
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
 
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotionAPIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
APIs REST Usables con Hypermedia por Javier Ramirez, para codemotion
javier ramirez
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful Approach
Mushfekur Rahman
 
BOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT HyderabadBOSS: Yahoo HackU IIIT Hyderabad
BOSS: Yahoo HackU IIIT Hyderabad
Saurabh Sahni
 
PHP Server side restful API - linkedin
PHP Server side restful API - linkedinPHP Server side restful API - linkedin
PHP Server side restful API - linkedin
Vũ Quang Sơn
 
BOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT BangaloreBOSS: Yahoo HackU IIIT Bangalore
BOSS: Yahoo HackU IIIT Bangalore
Saurabh Sahni
 
Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slides
Cisco DevNet
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIs
Siva Arunachalam
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
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
Rasan Samarasinghe
 
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
Dinis Cruz
 
Ad

More from Ho Chi Minh City Software Testing Club (12)

[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile
[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile
[HCMC STC Jan 2015] Workshop Of Context-Driven Testing In Agile
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Proving Our Worth Quantifying The Value Of Testing
[HCMC STC Jan 2015] Proving Our Worth  Quantifying The Value Of Testing[HCMC STC Jan 2015] Proving Our Worth  Quantifying The Value Of Testing
[HCMC STC Jan 2015] Proving Our Worth Quantifying The Value Of Testing
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...
[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...
[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Creating a Better Testing Future
[HCMC STC Jan 2015] Creating a Better Testing Future[HCMC STC Jan 2015] Creating a Better Testing Future
[HCMC STC Jan 2015] Creating a Better Testing Future
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams
[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams
[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Performing Target Test in UMTS Network
[HCMC STC Jan 2015] Performing Target Test in UMTS Network[HCMC STC Jan 2015] Performing Target Test in UMTS Network
[HCMC STC Jan 2015] Performing Target Test in UMTS Network
Ho Chi Minh City Software Testing Club
 
Selecting the Right Automated Testing tool
Selecting the Right Automated Testing tool Selecting the Right Automated Testing tool
Selecting the Right Automated Testing tool
Ho Chi Minh City Software Testing Club
 
Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...
Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...
Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...
Ho Chi Minh City Software Testing Club
 
[Vu Van Nguyen] Value-based Software Testing an Approach to Prioritizing Tests
[Vu Van Nguyen]  Value-based Software Testing an Approach to Prioritizing Tests[Vu Van Nguyen]  Value-based Software Testing an Approach to Prioritizing Tests
[Vu Van Nguyen] Value-based Software Testing an Approach to Prioritizing Tests
Ho Chi Minh City Software Testing Club
 
[Vu Van Nguyen] Test Estimation in Practice
[Vu Van Nguyen]  Test Estimation in Practice[Vu Van Nguyen]  Test Estimation in Practice
[Vu Van Nguyen] Test Estimation in Practice
Ho Chi Minh City Software Testing Club
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
[HCMC STC Jan 2015] Developing an Offshore Context-Driven Testing Team
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Proving Our Worth Quantifying The Value Of Testing
[HCMC STC Jan 2015] Proving Our Worth  Quantifying The Value Of Testing[HCMC STC Jan 2015] Proving Our Worth  Quantifying The Value Of Testing
[HCMC STC Jan 2015] Proving Our Worth Quantifying The Value Of Testing
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...
[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...
[HCMC STC Jan 2015] Choosing The Best Of The Plan-Driven And Agile Developmen...
Ho Chi Minh City Software Testing Club
 
[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams
[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams
[HCMC STC Jan 2015] How To Work Effectively As a Tester in Agile Teams
Ho Chi Minh City Software Testing Club
 
Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...
Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...
Ho Chi Minh City Software Testing Conference 2014 "Stay on the cutting-edge" ...
Ho Chi Minh City Software Testing Club
 
[Vu Van Nguyen] Value-based Software Testing an Approach to Prioritizing Tests
[Vu Van Nguyen]  Value-based Software Testing an Approach to Prioritizing Tests[Vu Van Nguyen]  Value-based Software Testing an Approach to Prioritizing Tests
[Vu Van Nguyen] Value-based Software Testing an Approach to Prioritizing Tests
Ho Chi Minh City Software Testing Club
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
Ho Chi Minh City Software Testing Club
 

Recently uploaded (20)

Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Raffi Khatchadourian
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
The Microsoft Excel Parts Presentation.pdf
The Microsoft Excel Parts Presentation.pdfThe Microsoft Excel Parts Presentation.pdf
The Microsoft Excel Parts Presentation.pdf
YvonneRoseEranista
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Hybridize Functions: A Tool for Automatically Refactoring Imperative Deep Lea...
Raffi Khatchadourian
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...Canadian book publishing: Insights from the latest salary survey - Tech Forum...
Canadian book publishing: Insights from the latest salary survey - Tech Forum...
BookNet Canada
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
The Microsoft Excel Parts Presentation.pdf
The Microsoft Excel Parts Presentation.pdfThe Microsoft Excel Parts Presentation.pdf
The Microsoft Excel Parts Presentation.pdf
YvonneRoseEranista
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 

Web API Test Automation Using Frisby & Node.js

  • 1. WEB API TEST AUTOMATION FRISBY – NODE.JS Bao Nguyen – Quang To SHIFT ASIA
  • 2. Agenda • Introduction • This session discusses: – Web API Test – Frisby – A case study from SHIFT ASIA • Technology discussed: – Node.js – REST APIs with JSON • Code download available at: – https://bitbucket.org/ShiftAsia/api_test 2
  • 3. Bao Nguyen • R&D Manager at SHIFT ASIA • Full-stack developer Quang To • Test Engineer at SHIFT ASIA • Experience in various aspects of Testing 3 Introduction
  • 4. Objectives Upon completion of the meetup, audiences should be able to: • Understand Web APIs • Differentiate SOAP from REST Web APIs • Learn well-known API Test tools • Develop API Test Automation using Frisby and Node.js 4
  • 7. API – Overview 7 API Web Service SOAP REST
  • 8. SOAP • Simple Object Access Protocol • Standardized protocol • Rely heavily on XML • Use WSDL (Web Service Definition Language) as a contract between the provider and the consumer of the service REST • REpresentational State Transfer • Architectural style • JSON is preferred • Use HTTP standard verbs, such as: GET, POST, PUT, DELETE 8 SOAP vs. REST
  • 9. Why API Test? • System complexity increased Multi-tiered model with private APIs making up the middleware • A huge demand of public APIs • Getting feedback as soon as possible 9
  • 10. API – Hierarchy of Needs 10 apiux.com
  • 11. Web REST API Call 11 1 Request Url + Verb 2 Respons e Status code + Header + Body http://swapi.co/api/people/1/ allow →GET, HEAD, OPTIONS content-type →application/json vary →Accept { "name": "Luke Skywalker", “height": "172", “mass": “77", “hair_color": “blond“, … } HTTP status →200 OK
  • 12. Web API Test Checkpoints • Status code • Returned value • Schema • Response time 12
  • 13. API Test Tools • Scriptless tools 13 • Scripting tools/frameworks
  • 15. Frisby – Overview • REST API testing framework built on Node.js • Simple • Fast • Continuous Integration • http://frisbyjs.com/ • npm install --save-dev frisby 15
  • 16. API Verbs 16 HTTP Verb CRUD Entire Collection (e.g. /users) Specific Item (e.g. /users/{id}) POST Create 201 (Created) 404 (Not Found), 409 (Conflict) if resource already exists. GET Read 200 (OK) 200 (OK), single user. 404 (Not Found), if ID not found or invalid. PUT Update/Replace 404 (Not Found) 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid. PATCH Update/Modify 404 (Not Found) 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid. DELETE Delete 404 (Not Found) 200 (OK). 404 (Not Found), if ID not found or invalid.
  • 17. Frisby – Methods • HTTP methods – Post() – Get() – Put() – Patch() – Delete() 17
  • 18. Frisby – Methods • Expectations – expectStatus() – expectHeader() – expectHeaderContains() – expectHeaderToMatch() – expectJSON() – expectBodyContains() – expectJSONTypes() – expectJSONLength() – expectMaxResponseTime( ) 18 Status code Returned value Returned value Returned value Returned value Returned value Schema Schema Response time
  • 19. Frisby – Demo • POST • GET • PUT • DELETE 19
  • 20. Frisby – Challenges • Documentation Lack of more detailed examples • Poor debugging info 20
  • 21. Frisby – Challenges • Asynchronous • Demo 21 Test API 1 API 2 Request 1 Response 1 Request 2 Response 2 Response values transferred
  • 22. Frisby – Challenges • Solution = Callback • Demo 22
  • 23. Frisby – Challenges • Another concern with Callback • Demo 23
  • 25. Frisby – Challenges • Solution = async • npm install --save async • Demo 25
  • 26. 26 A Case Study from SHIFT ASIA
  • 27. SHIFT ASIA – Methodology 27 Requirements User Stories Test Cases Test Scripts Test Designer Test Engineer Tester Tester
  • 28. #AutomateBuild #AutomateTestExecution #AutomateReporting SHIFT ASIA – Case Study 28 TEST SCRIPT Tester #TestDevelopment SCRIPT GENERATION Test Engineer #Utility #Helpers HARD-CORE Test Architect #StandardStructure #NamingConvention #Settings #Modules Node.js FrisbyJasmine-node shelljs Helper modules Test in Yaml Data in Yaml Yaml to JSON files Run API tests
  • 29. SHIFT ASIA – Case Study 29 Yaml to JSON JSON to Spec Run Tester
  • 30. © 2014 HCMC Software Testing Club THANK YOU