
Set up the development environment and install the required tools, then explore rest service basics, Maven, and Karate framework testing with assertions, reports, and multi-environment integration.
Download JDK 11.0.7 from the official site and install with default configuration. Create a system variable JAVA_HOME pointing to the JDK directory and add %JAVA_HOME%\bin to PATH, then restart the command prompt and verify the version.
Download and install the official Postman executable from the official website, then log in or relaunch to skip the login prompt, and use Postman to send requests and analyze responses.
Set up Eclipse IDE for rest api testing with Karate by downloading, unzipping, launching, configuring a workspace, and installing the Cucumber plugin from the Eclipse Marketplace.
Set up Maven locally to run tests from the command line by downloading binaries, unzipping them, configuring the Maven location and path, and verifying installation with mvn -version.
Learn to set up the test application for rest api testing locally by running the jar, access swagger at localhost:9897/swagger.html, and verify endpoints with a Postman get request returning 200.
Explore the rest architectural style, its guiding principles: client-server, stateless, cacheable, uniform interface, layered system, code on demand, and how http enables lightweight web services with json or xml.
The client sends a request to the server, which processes it and returns a response, illustrated by a payment gateway service.
Explore http methods for rest api testing, mapping create to post, read to get, update to put, delete to delete, and patch for partial updates.
Explore the request and response format in REST API testing, detailing optional headers and body, the required http method, and the status code, with a GET request in Postman.
Explore how REST APIs work in real time by inspecting browser requests and server responses, including HTTP methods, status codes, headers, and response bodies, with YouTube and Facebook examples.
Master the Maven tool to automate builds, manage dependencies, and run tests from the command line, using pom.xml to configure project structure and packaging as jar or war.
Understand the Maven build life cycle with clean, compile, and test. Clean deletes bin class files, compile compiles the Java file, and test runs tests under src test Java.
Learn to set up a Karate Maven project, use the Karate archetype, configure Java 11, and organize code under com.api.automation with a feature file and runner, leveraging built-in keywords.
Explore gherkin keywords for rest api testing with karate framework, including feature, scenario, given, when, then, and, scenario outline, and background. Learn how to structure a feature file in eclipse.
Learn how to perform http get requests to fetch data from a server, verify 200 responses, and implement karate framework tests using a feature file with given url and endpoint.
Create a test runner in karate using JUnit 5 to execute scenarios from a feature file, employing relative to and class path approaches to locate the file.
Learn to use karate's path keyword to assemble endpoint URLs by combining the base path with a changing context path, and apply end or given for runtime scenarios.
Explore HTTP headers, including request and response headers, and learn how to use the Accept header to request JSON or XML data with Karate's header keyword.
Learn how the Karate framework stores the response in a variable named response for assertions, then run multiple feature files to view json and xml outputs.
Use the match keyword to validate entire responses, negate conditions, and find specific properties in json or xml. Employ deep contains for nested json objects and arrays, and response headers.
Validate json array contents with karate by navigating nested arrays using indices, validating sizes, and extracting job id, experience, project, and technology, then apply wildcard and contains for flexible assertions.
Validate xml responses with xpath in karate, using forward slashes and the dot operator to traverse list items and job fields, compare values, and mirror json traversal.
Explore how the Karate fuzzy matcher enables flexible validation by ensuring a property is present in the response, regardless of its value, for json and xml.
Explore advanced fuzzy matcher usage in Karate framework, validating JSON and XML responses with JavaScript expressions, self variable, and array and string length checks for robust tests.
Create variables directly in the feature file using def or star, assign values, and print them; explore per-scenario and background scope and data reuse.
Learn how to read expected responses from external json and xml files in Karate, using read to populate data, and validate with matchers in feature files.
Create and test a post request with karate by building a feature file, configuring the base URL, crafting a JSON body with headers, and verifying a 201 response.
Learn how to read the post request body from an external json or xml file in Karate framework, replacing hardcoded payloads with data-driven inputs.
Explore karate schema validation for json data using fuzzy matcher, defining properties and types like integer job id and string job title; note xml schemas aren’t supported.
Learn how to define and execute JavaScript functions inside a Karate feature file, return constants, generate random values, pass arguments, and run tests with a runner.
Use embedded expressions in the karate framework to replace hardcoded values with variables in json or xml request bodies, with runtime resolution via JavaScript function generating a random job id.
Master validating complex json schemas in Karate by using embedded expressions and fuzzy matchers to validate arrays of objects in get endpoint responses.
Karate is an open-source general-purpose test-automation framework that can script calls to HTTP end-points and assert that the JSON or XML responses are as expected. Karate is implemented in Java but test-scripts are written in Gherkin since Karate was originally an extension of the Cucumber framework.
Karate is built on top of Cucumber, another BDD testing framework, and shares some of the same concepts. One of these is the use of a Gherkin file, which describes the tested feature. However, unlike Cucumber, tests aren't written in Java and are fully described in the Gherkin file.
From this course, you will learn the following concepts.
Web Service Introduction
What is the REST service?
What are Requests and Responses?
CRUD operations
Request and Response format
Live example of API calls
Karate Framework
GET/POST/PUT/PATCH/DELETE Request
Data-Driven with Scenario Outline
Dynamic Scenario Outline
Creating Parallel runner
Assertions
Using match
JSON Array matching
Schema validation
Fussy matcher
JSON Path
Tagging
Tags and Run with tags
How to ignore a scenario
Getting a tag and feature file from the system property
Report Generation
Cucumber Report Generation
Karate Report Generation
Authentication
Hard-Coded credentials & Token based
Using the Java Script file
CI/CD – Jenkins
Jenkins Pipeline Concept
Jenkins Multibranch pipeline