10. API Testing Process
Record,
Define API
Information
Parsing, Filter or
Recording API
Data And then
extract
Reconstruction
API calls, and
sent them from a
simulate client
Test Validation
2/14/2019 API Testing World 8
13. API Testing
Automation
• Repeatable
• Mandatory
• Long Term
• Regression
Text Here
Manual
• Explorary
• Frequently
2/14/2019 API Testing World 11
VS
19. Normal Scenario Abnormal Scenario
2/14/2019 API Testing World 17
Behavior Driven
Development with JBehave
20. BDD With JBehave
The Step Overview
Gherkin Syntax
(Given, When, Than)
Write Story
Configure steps
script and validation
Map Steps to Java
Combine stories and
steps
Configure Stories
IntellijIDEA,
maven
Run Stories
Make a report using
Serenity
View Reports
1 2 3 4 5
2/14/2019 API Testing World 18
21. REST ASSURED
And The Features
Use of Hamcrest matches for checks (equalTo)
Supports for HTTP methods
User of Gpath for selecting element from JSON response
Java library for API testing
Supports for BDD / Gherkin (Given, When, Then)
2/14/2019 API Testing World 19
22. WRITING THE TEST
Using Rest Assured
RestAssured
.when()…
.given()…
.then()…
Test Setup
Test Action
Test Verification
.contentType()
.header()
.get(url), .post(), .put(), .delete(), etc.
.log().all()
.statusCode()
.body(“data.nama”, equalTo(“Kentir”))
2/14/2019 API Testing World 20