Menu

API Test Automation Workshop

The Agile way of working, DevOps practices to enable CI/CD, and evolving architecture using Microservices have enabled our software to change at a rapid pace. This forces us to swiftly test our frequent releases.

Hence it is very important to have reliable sets of tests that provide fast feedback. Automated API tests are meant to fill this need.

This hands-on workshop will give you the required knowledge to kick-start your automated API testing using Karate, an open-source testing tool.

End-to-end functional tests driven from the GUI are typically too slow, fragile and complex. Since API tests do not rely on GUI to be ready, they can be created early in the software development process, often before the GUI is created, allowing us to find potential bugs faster and hence shift testing left. Also, API testing allows us to make requests that might not be allowed through the GUI, which is crucial for exposing potential security flaws in an application.

While some end-to-end functional GUI tests will be needed to verify if UI elements appear correctly and can be interacted with, API tests are much faster and more reliable. API tests will allow you to rapidly set up server state and run series of API validations very efficiently, allowing you to focus on testing your core business logic along with database transactions and other microservice integration.

In this workshop, we will learn how to automate tests for RESTful APIs and build components essential for a comprehensive and scalable API testing framework.

Agenda

  • Getting started (4 hours)
    • Module 1 – Test pyramid
    • Module 2 – Introduction to Web Services
    • Module 3 – Introduction to Karate
    • Module 4 - Automate API tests using Karate
    • Assignment 1
  • Deep-dive (4 hours)
    • Module 5 - Automate API tests using Karate
    • Module 6 - Data Driven tests
    • Module 7 - Test categorization
    • Module 8 - Parallel execution
    • Module 9 - Scaling your implementation
    • Module 10 - Custom functions
    • Module 11 - Reporting
    • Assignment 2
Testing Pyramid

Learning Outcome

At the end of this workshop the team will be able to:

  • Understand the importance of the Test pyramid and where API tests fit
  • Learn the fundamentals of API testing (at individual API and Workflow level)
  • Understand how REST requests work so you can effectively test them
  • Implement request set up and assertions to test REST services with Karate and Postman
  • Learn how to analyse Karate reports and logs
Karate API Test


Course Outline

Getting Started (4 hours)

Module 1 - Test pyramid

  • Test Exercise
  • Understand the need of testing at API Layer
  • Understanding the test pyramid
    • Types of tests
    • Roles
    • Where to test what layer?

Module 2 - Introduction to Web Services

  • Understand What, Why and How of Web Services
  • Types of Web Services
  • Structure of a API
  • Introduction to SOAP & RESTful services
  • REST vs SOAP

Module 3 - Introduction to Karate

  • Intro to BDD - Feature files
  • Introduction to Karate
  • Setup karate using Maven/Gradle
  • Configuring Karate
  • Running the Karate tests and seeing results in default reporter & karate.log

Module 4 - Automate API tests using Karate

  • Resources methods/verbs
  • Automation Exercise
    • GET
    • GET with Path Parameters
    • GET with Query Parameters
    • POST
      • API Authentication and Authorization
      • Setting headers with auth tokens
      • JSON Body
  • Debugging
  • Automation Exercise: Build Workflow using GET / POST
  • Extracting values from responses and using in subsequent calls

Assignment 1

  • PUT & DELETE - Explain the API, examples of usage
  • Automate & validate
  • Exercise: Extend/build new workflow using combination of above

Deep Dive (4 hours)

Module 5 - Automate API tests using Karate

  • Request headers
  • Response headers
  • Response validations with Karate
  • Understanding JSON and writing JsonPaths
  • Assertions
  • Schema validations

Module 6 - Data Driven tests

  • CSV files
  • YAML files
  • Data Tables

Module 7 - Test categorization

  • Add tags in tests
  • Run specific tests based on tags

Module 8 - Parallel execution

  • Criteria for parallel test execution
  • Configuring tests for parallel execution

Module 9 - Scaling your implementation

  • Reuse the feature files
    • How to specify parameters
    • Different ways to get return values from called scenario
    • Calling scenarios in loop

Module 10 - Custom functions

  • Call java/js scripts in the feature files

Module 11 - Reporting

  • Default reporters
  • Custom reporters

Assignment 2

  • Build end-to-end workflow tests based on above learning

Training Details

Method of Instruction

Interactive Dialogues, Hands-on Exercises and Demos

Transfer %

Knowledge: 70%, Skill-Building: 30%

Target Audience

  • Primary: Developers, QA, Automation Engineers/SDETs
  • Secondary: Technical Managers, Business Analysts, Architects

Course Level

Beginner to Intermediate

Course Prerequisites

  • Required: Understanding of testing and automation in general
  • Highly Recommended: basic understanding of the life-cycle of software projects

General Requirements

To ensure a successful workshop, we require the following facilities:

Machine Setup Instructions

Participants should have the following setup ready on their machine:

In-person Training Room Setup

  • HDMI projector (1024x768 minimum) & Projector screen
  • 1 White board & Dry erase markers
  • Cluster seating with 5-6 people on each table
  • 1 Flip chart with the stand and marker pens for each table
  • Notepad and Pen for each participant


Testimonials

"Inversion of Software Development", that's what Naresh gave me through his 5 days workshop at Amazon. He is one of the best mentors I encountered in my career.

The way he tries to explain TDD and Design principles with practical approaches, always challenging the concepts which we used to think were industry standards. Learning through his workshop, now coding is like blogging, drop dead simple, and you don't look back.

I hope we had more dojos like Naresh mentoring people in Indian Software Industries to let them know what real clean software development is all about. To sum up he instilled the idea - "Perfection isn't the goal, it's the baseline." about software development in me.

- Rajat Talwar, Software Engineer II, Amazon

It's been 3 weeks since I had the opportunity to attend a 3-Day TDD workshop followed by a 3-Day Design Patterns workshop by Naresh Jain. Post the workshops; I was able to fully test drive a feature that is already in production.

I had many take-away from his workshops, but the most important ones were - 1. It gave me the confidence that with TDD you can come up with good designs, 2. Learnt refactoring techniques and IDE tricks, 3. Got a deeper understanding of design values, principles and patterns. 4. Identifying code smells (the codes that I was proud of, now all I see there is code smells :P). But thanks to Naresh I know how to make it right.

- Chandan Kumar, Software Development Engineer, Amazon

I recently met Naresh Jain during Test Driven Development(TDD) training at my current organisation. He is very knowledgeable and also very effective as a trainer. His enthusiasm and confidence is a game-changer when it comes to motivating the workshop participants.

I've really benefited from his training and by applying TDD in my day-to-day work . It was a great experience and I wish, I could get a chance to work with him on a real project.

- Lokesh Gaur, Technical Lead,Samsung Research

Rarely have I met a trainer who was truly hands-on. The depth of knowledge and on-field experience of Naresh Jain is truly inspiring. His proficiency in agile techniques and TDD is bleeding edge.

We have benefited immensely in barely three days of TDD training with him. We wish he was on our team here in EMC2.

- Vimal Kumar, Principal Software Engineer, EMC2


Recently I attended Naresh's workshop on Test Driven Development (TDD) at Amazon, Hyderabad. It was a great learning experience and an eye-opener in few cases.

He is very involved with the Agile community and has worked with a lot of industry experts. That's the best part of getting trained by him. He is up-to-date with the latest trends and his skills are very relevant.

Naresh's in-depth knowledge and great attitude, fueled by his passion for technology makes him a great techie to work with. I had a great experience and would highly recommend him for training/coaching or even just to have good discussions.

- Akshay Johri, Software Development Engineer, Amazon

Our Complete Training Guide

Trainings

Contact Us

Reach out to start a conversation

Send Us A Message

Sending...
Something went wrong. Please try again.
Your message was sent, thank you!

Contact Info

Where to Find Us

No 20, 12th Cross
Bengaluru, KA
560002 IN

Email Us At

contact@xnsio.com
info@xnsio.com