SlideShare a Scribd company logo
1 of 41
Quick start to Rest Assured
Szymon Ramczykowski
Lead Test Engineer/Workday Smart
Agenda
11/01/2018 2
1. Context
2. Authentication
3. GET Request
4. POST Request
5. PUT Request
6. END2END Scenarios
7. Summary
Rest Assured vs Selenium
11/01/2018 3
HTTP REQUESTS
11/01/2018 4
Client Server
GET/POST/PUT/DELETE
11/01/2018 5
Client Server
Resources/Endpoints
Examples
11/01/2018 6
GET https://sampleurl.fake/customers
POST https://sampleurl.fake/customer?name=Steve&surname=Doe
PUT https://sampleurl.fake/customer
DELETE https://sampleurl.fake/customer?id=983987as2
RestAssured
11/01/2018 7
http://rest-assured.io/
Tested application
11/01/2018 8
https://trello.com
https://developers.trello.com/v1.0/reference
Authentication
11/01/2018 9
Authentication
11/01/2018 10
VS https://trello.com/app-key
Authentication
Reuse authenticate method in specification
11/01/2018 11
Authentication
Summary
11/01/2018 12
Trello:
1. User name and password authentication
2. Key and token authentication
Other apps
1. Cookies
2. Tokens
3. Many more
GET
11/01/2018 13
1. View board data
2. View cards for given boards
3. View list for given boards
GET
Exercise 1- display board
11/01/2018 14
GET
Exercise 1- add authentication and endpoint
11/01/2018 15
GET
Exercise 1- add authentication and endpoint
11/01/2018 16
GET
Exercise 1- test method with pretty print
11/01/2018 17
GET
Exercise 1- display board id
11/01/2018 18
GET
Exercise 1- display board id
11/01/2018 19
GET
Exercise 1- display board id
11/01/2018 20
GET
Exercise 1- display board id
11/01/2018 21
GET
Exercise 2- display cards
11/01/2018 22
GET
Exercise 2- using getBoardId as parameter
11/01/2018 23
GET
Exercise 2- get card id
11/01/2018 24
GET
Exercise 2- get card id
11/01/2018 25
GET
Exercise 2- testing methods
11/01/2018 26
GET
Exercise 3- list display
11/01/2018 27
Endpoint: /boards/boardId/lists
1. Display list method
2. Display list id
3. Test both methods
GET
Summary
11/01/2018 28
1. Reuse of specification
2. Response object/Json mapping
3. Get items id: boards, cards, lists
POST
11/01/2018 29
1. Create new board
2. Create card on new board
3. Create list on new board
POST
Exercise 1 create board
11/01/2018 30
Endpoint: /boards/
1) Handle authentication
2) Add parameter: queryParam(“name”, ”Your
board name”);
POST
Exercise 2 create card
11/01/2018 31
Endpoint: /cards/
1) Handle authentication
2) Add parameter: queryParam(“name”, ”Your
card name”);
3) Add parameter: queryParam(“idList”, “Your
list id); //reuse getId method from
GetRequests class.
POST
Exercise 3 create list
11/01/2018 32
Endpoint: /lists/
1) Handle authentication
2) Use trello documentation to find out what
parameters you need to add new list
https://developers.trello.com/v1.0/reference
POST
Summary
11/01/2018 33
1) Authentication
2) Reuse of get methods
3) Created new board, card list
PUT
Exercises
11/01/2018 34
1) Change card name
2) Move card to other list
3) User trello documentation to get
parameters and endpoints
4) Reuse getId methods where appropriate
PUT
Summary
11/01/2018 35
1) Used documentation of trello.
2) Reused getId methods.
END2END testing
11/01/2018 36
1. Create new board with unique name
2. Create 4 cards on new board
3. Create new list on new board
4. Rename one of the cards
5. Move one of the cards to list Doing
6. Move other card to list Done
7. Move other card to new list
Summary
11/01/2018 37
What we did:
- Covered 7 Endpoints
- GET(Board, Card, List)
- POST(Board, Card, List)
- PUT(Cards)
- Different aspects of authentication
- Using of documentation
- Using network tab
- Response handling
- End 2 end testing with methods reuse.
Summary
11/01/2018 38
What we could do:
- Start flow from post request
- Cast json data to java classes
- Data clean up
- Better structure of project
Summary
11/01/2018 39
What you can do:
- Experiment with examples, enhance those, add
parametrization, add other test cases
- Experiment with other apps
- Jira
- Facebook
- Twitter
- Your company app
- Learn other tools: Postman, SoapUI, JMeter, Gatling
Code with answers available in repo:
https://github.com/szmc/aadays-restassured-workshops
Questions?
11/01/2018 40
Thank you!
11/01/2018 41

More Related Content

Similar to [TestWarez 2017] Quick start to Rest-assured library: learn how to enhance test automation of web application with fast and reliable test suite

Plant Name Services Using Tropicos
Plant Name Services Using TropicosPlant Name Services Using Tropicos
Plant Name Services Using Tropicos
Chris Freeland
 
Sitecore 7: A developers quest to mastering unit testing
Sitecore 7: A developers quest to mastering unit testingSitecore 7: A developers quest to mastering unit testing
Sitecore 7: A developers quest to mastering unit testing
nonlinear creations
 
Step4 managementsendsorderw
Step4 managementsendsorderwStep4 managementsendsorderw
Step4 managementsendsorderw
Hüseyin Çakır
 

Similar to [TestWarez 2017] Quick start to Rest-assured library: learn how to enhance test automation of web application with fast and reliable test suite (20)

Play framework
Play frameworkPlay framework
Play framework
 
Rational Publishing Engine and Rational ClearQuest
Rational Publishing Engine and Rational ClearQuestRational Publishing Engine and Rational ClearQuest
Rational Publishing Engine and Rational ClearQuest
 
18CSL48.pdf
18CSL48.pdf18CSL48.pdf
18CSL48.pdf
 
Plant Name Services Using Tropicos
Plant Name Services Using TropicosPlant Name Services Using Tropicos
Plant Name Services Using Tropicos
 
ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection
 
Struts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configurationStruts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configuration
 
Sitecore 7: A developers quest to mastering unit testing
Sitecore 7: A developers quest to mastering unit testingSitecore 7: A developers quest to mastering unit testing
Sitecore 7: A developers quest to mastering unit testing
 
Jazz
JazzJazz
Jazz
 
Apps1
Apps1Apps1
Apps1
 
Inventory management system
Inventory management systemInventory management system
Inventory management system
 
inventory management system
 inventory management system inventory management system
inventory management system
 
Amali VRF
Amali VRFAmali VRF
Amali VRF
 
RESTful Day 6
RESTful Day 6RESTful Day 6
RESTful Day 6
 
Actual test case document
Actual test case documentActual test case document
Actual test case document
 
Log Analysis
Log AnalysisLog Analysis
Log Analysis
 
Step4 managementsendsorderw
Step4 managementsendsorderwStep4 managementsendsorderw
Step4 managementsendsorderw
 
Practical JavaScript Programming - Session 5/8
Practical JavaScript Programming - Session 5/8Practical JavaScript Programming - Session 5/8
Practical JavaScript Programming - Session 5/8
 
Modern developer workflow
Modern developer workflowModern developer workflow
Modern developer workflow
 
API Testing Presentations.pptx
API Testing Presentations.pptxAPI Testing Presentations.pptx
API Testing Presentations.pptx
 
Constraints Make You Sexy - What is Rest
Constraints Make You Sexy  - What is RestConstraints Make You Sexy  - What is Rest
Constraints Make You Sexy - What is Rest
 

More from Stowarzyszenie Jakości Systemów Informatycznych (SJSI)

7 Skills for highly effective teams - workshop
7 Skills for highly effective teams - workshop7 Skills for highly effective teams - workshop
7 Skills for highly effective teams - workshop
Stowarzyszenie Jakości Systemów Informatycznych (SJSI)
 
Dancing with the devil - how to cooperate with a problematic customer
Dancing with the devil - how to cooperate with a problematic customerDancing with the devil - how to cooperate with a problematic customer
Dancing with the devil - how to cooperate with a problematic customer
Stowarzyszenie Jakości Systemów Informatycznych (SJSI)
 
[TestWarez 2017] Przychodzi tester na rozmowę...
[TestWarez 2017] Przychodzi tester na rozmowę...[TestWarez 2017] Przychodzi tester na rozmowę...
[TestWarez 2017] Przychodzi tester na rozmowę...
Stowarzyszenie Jakości Systemów Informatycznych (SJSI)
 
[TestWarez 2017] A proper gun makes testing fun
[TestWarez 2017] A proper gun makes testing fun[TestWarez 2017] A proper gun makes testing fun
[TestWarez 2017] A proper gun makes testing fun
Stowarzyszenie Jakości Systemów Informatycznych (SJSI)
 

More from Stowarzyszenie Jakości Systemów Informatycznych (SJSI) (20)

Star Trek: BDD Enterprise
Star Trek: BDD EnterpriseStar Trek: BDD Enterprise
Star Trek: BDD Enterprise
 
Model based testing as a BA tool
Model based testing as a BA toolModel based testing as a BA tool
Model based testing as a BA tool
 
Communication - Language of Leader
Communication - Language of LeaderCommunication - Language of Leader
Communication - Language of Leader
 
Miękkie umiejętności w pracy analityka biznesu
Miękkie umiejętności w pracy analityka biznesuMiękkie umiejętności w pracy analityka biznesu
Miękkie umiejętności w pracy analityka biznesu
 
Błędy w analizie z praktyki (nowe wydanie  )
Błędy w analizie z praktyki (nowe wydanie  )Błędy w analizie z praktyki (nowe wydanie  )
Błędy w analizie z praktyki (nowe wydanie  )
 
7 Skills for highly effective teams - workshop
7 Skills for highly effective teams - workshop7 Skills for highly effective teams - workshop
7 Skills for highly effective teams - workshop
 
Dancing with the devil - how to cooperate with a problematic customer
Dancing with the devil - how to cooperate with a problematic customerDancing with the devil - how to cooperate with a problematic customer
Dancing with the devil - how to cooperate with a problematic customer
 
Cosmic truths about software requirements
Cosmic truths about software requirementsCosmic truths about software requirements
Cosmic truths about software requirements
 
Zagraj w zaangażowanie
Zagraj w zaangażowanieZagraj w zaangażowanie
Zagraj w zaangażowanie
 
Analiza prawdziwie biznesowa - skąd biorą się projekty
Analiza prawdziwie biznesowa - skąd biorą się projektyAnaliza prawdziwie biznesowa - skąd biorą się projekty
Analiza prawdziwie biznesowa - skąd biorą się projekty
 
Internet of Things loves data - analysis of Industry 4.0
Internet of Things loves data - analysis of Industry 4.0Internet of Things loves data - analysis of Industry 4.0
Internet of Things loves data - analysis of Industry 4.0
 
Start with Accessibility: Why, How and What
Start with Accessibility: Why, How and WhatStart with Accessibility: Why, How and What
Start with Accessibility: Why, How and What
 
Agile business analyst
Agile business analystAgile business analyst
Agile business analyst
 
Analityk i architekt w czasach automatyzacji i robotyzacji biznesu
Analityk i architekt w czasach automatyzacji i robotyzacji biznesuAnalityk i architekt w czasach automatyzacji i robotyzacji biznesu
Analityk i architekt w czasach automatyzacji i robotyzacji biznesu
 
Jak sprzedać swój pomysł w 5 minut, czyli pitch deck dla BA
Jak sprzedać swój pomysł w 5 minut, czyli pitch deck dla BAJak sprzedać swój pomysł w 5 minut, czyli pitch deck dla BA
Jak sprzedać swój pomysł w 5 minut, czyli pitch deck dla BA
 
7 Skills for highly effective teams
7 Skills for highly effective teams7 Skills for highly effective teams
7 Skills for highly effective teams
 
[TestWarez 2017] Skomplikowane testowanie, skomplikowane terminy. Testowanie ...
[TestWarez 2017] Skomplikowane testowanie, skomplikowane terminy. Testowanie ...[TestWarez 2017] Skomplikowane testowanie, skomplikowane terminy. Testowanie ...
[TestWarez 2017] Skomplikowane testowanie, skomplikowane terminy. Testowanie ...
 
[TestWarez 2017] Przychodzi tester na rozmowę...
[TestWarez 2017] Przychodzi tester na rozmowę...[TestWarez 2017] Przychodzi tester na rozmowę...
[TestWarez 2017] Przychodzi tester na rozmowę...
 
[TestWarez 2017] A proper gun makes testing fun
[TestWarez 2017] A proper gun makes testing fun[TestWarez 2017] A proper gun makes testing fun
[TestWarez 2017] A proper gun makes testing fun
 
[TestWarez 2017] Zen testów wydajnościowych
[TestWarez 2017] Zen testów wydajnościowych[TestWarez 2017] Zen testów wydajnościowych
[TestWarez 2017] Zen testów wydajnościowych
 

Recently uploaded

Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
drm1699
 

Recently uploaded (20)

The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Rapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and InsightsRapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and Insights
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
 
[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)
 
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 

[TestWarez 2017] Quick start to Rest-assured library: learn how to enhance test automation of web application with fast and reliable test suite

Editor's Notes

  1. Rest assured vs selenium
  2. GET is about getting data. DataDriven testing Write those methods so you can reuse those in other excercises.
  3. Use methods from GetRequest class!