Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Cucumber Cookbook

You're reading from   Cucumber Cookbook Over 35 hands-on recipes to efficiently master the art of behaviour-driven development using Cucumber-JVM

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785286001
Length 162 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Shankar Garg Shankar Garg
Author Profile Icon Shankar Garg
Shankar Garg
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Cucumber Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Writing Feature Files FREE CHAPTER 2. Creating Step Definitions 3. Enabling Fixtures 4. Configuring Cucumber 5. Running Cucumber 6. Building Cucumber Frameworks Index

Building a REST Automation framework


HTTP Client is an open source REST services library developed by Apache. I am using HTTP Client for this framework because this is a pure Java implementation and is very easy to use. We need to create an instance of the HTTP client and then just use one of the already defined functions.

Since there is no UI involved and there is a limit to the functions that we need to use, there is no need for the POM in this framework. Let's learn how we can create a robust REST automation framework using Cucumber and HTTP Client.

Note

I am just giving a demo of REST Services automation, the same project and framework can be used for SOAP automation as well.

How to do it…

Let's first understand the test case that we will use in this framework. I am going to test the GET and POST methods. Let me walk-through the test Steps.

  1. Send a GET request to the GitHub URL at https://api.github.com/users/ShankarGarg to verify the user details.

  2. Send a POST request to the Apple service center...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images