
Overview on the karate framework we are going to study as part of this lecture.
Explore the training overview to locate materials and test steps for upcoming sessions, with a PowerPoint presentation and a code base zip file to guide your test scripts.
Install Java 11 or 24 and configure environment variables on your OS, install Eclipse and the Cucumber plugin, set up Maven, and optionally Postman to validate APIs for Karate.
Karate configuration we are going to study
Configure a Maven-based Karate project by importing dependencies, creating a feature file and runner, and validating with Karate JUnit, using Eclipse or VS Code on Java 17, 21, or 24.
Configure the karate framework in VS Code using quickstart to create a project, modify pom.xml, and set up features with GitHub Copilot for generating API test scripts.
Compare com.intuit.karate and io.karatelabs to see that both open source and commercial versions offer API, UI, and performance testing; the commercial adds cloud platform, advanced reporting, and professional support.
Maven is a build automation tool that manages dependencies and artifacts via pom.xml. This overview shows creating a maven project in eclipse and managing dependencies from the maven central repository.
Configure karate framework in IntelliJ by creating a Java project, adding karate dependencies via Maven, and running a get users scenario to verify a 200 response.
Overview on API testing
Explore rest and web services, focusing on http requests and responses, client-server interactions. Learn http methods like get, post, put, delete, patch, and data formats such as json and xml.
Learn how Cucumber BDD enables behavior driven development by translating automation tests into plain English with Gherkin keywords, feature files, scenarios, scenario outlines, and given, when, then.
GET Example using Karate
Scenario: Verify current whether data
Given url 'api.openweathermap.org/data/2.5/weather?q=London&appid=3c322ae59a7b42'
When method get
Then status 200
Feature: validate variables concept
Background:
Given def company_name = "Lebyy.com"
Scenario: verify varaible data type
Given def employee_name = "surendra"
When def employee_id = 456
Then print employee_id
Then print employee_name
Then print "Employee ID value is", employee_id
Then print "Employee name is" ,employee_name
Then print "Company name is", company_name
Scenario: reuse of variable
Then print "Employee name is" ,employee_name
Then print "Company name is", company_name
Background:
Given url 'https://dummy.restapiexample.com'
Scenario: To get all employees information in JSON format
And path '/api/v1/employees'
And header Accept = 'application/json'
When method get
Then status 200
Scenario: To get specific employee details
And path '/api/v1/employee/1'
And header Accept = 'application/json'
When method get
Then status 200
Scenario: To get specific employee details
And path '/api/v1/employee/1'
And header Accept = 'application/json'
When method get
Then status 200
And print response.data.employee_salary
And print response.data.employee_name
And print response.data.id
And print response.data.employee_age
And print response.status
Execute and validate api tests with karate; inspect the generated execution report detailing pass/fail counts, status codes, timing, and scenario details, and learn how to refresh or customize reports.
Overview on JSON with examples
Assertions
Feature: Title of your feature
Background:
Given url 'https://dummy.restapiexample.com'
Scenario: To get all employees information in JSON format
And path '/api/v1/employees'
And header Accept = 'application/json'
When method get
Then status 200
And match header Content-Type == 'application/json'
And match response contains deep {"data":[{"id":1}]}
And match response contains deep {"data":[{"employee_name":"Caesar Vance"}]}
And match response.data == "#[24]"
#And match each response.data[*].employee_name contains "surendra"
And match response.data[*].employee_name == ["Garrett Winters","Tiger Nixon","Ashton Cox","Cedric Kelly","Airi Satou","Brielle Williamson","Herrod Chandler","Rhona Davidson","Colleen Hurst","Sonya Frost","Jena Gaines","Quinn Flynn","Charde Marshall","Haley Kennedy","Tatyana Fitzpatrick","Michael Silva","Paul Byrd","Gloria Little","Bradley Greer","Dai Rios","Jenette Caldwell","Yuri Berry","Caesar Vance","Doris Wilder"]
#Scenario: To get specific employee details
#And path '/api/v1/employee/1'
#And header Accept = 'application/json'
#When method get
#Then status 200
#And match response.data.employee_salary == 320800
#And match response.data.employee_name == "Surendra Jaganadam"
Examples on Scenario Outline , Def, print
Karate Tutorial POST example
Fetch the employee list via a get request and validate the full response structure with karate's match each, ensuring optional profile image, mandatory employee name, and numeric salary and age.
Karate Runner configuration , Karate Options
Calling other feature
Karate Assertions with examples Part 2
Karate Schema validations Part 1
Karate Schema validations Part 2
Feature: Validate embedded expressions
Scenario: To POST an entry using expressions
Given url 'https://reqres.in/api/users'
And header Accept = 'application/json'
Then def empName = "surendra jaganadam"
Then request { "name": '#(empName)',"job": "mobile automation tester" }
When method post
Then status 201
Scenario: To get all employees information in JSON format
Given url 'https://thetestrequest.com/authors/1.xml'
And header Accept = 'application/xml'
Then def authorName = "Surendra Lebyy"
When method get
Then status 200
And match response.hash.name == '#(authorName)'
Feature: validations with examples
#Scenario: To get all employees information in JSON format
#And url 'https://jsonplaceholder.typicode.com/posts/1'
#When method get
#Then status 200
#And def schemaVal = {"userId": '#number', "id": '#number', "title": '#string', "body": '#string'}
#Then match response ==
#"""
#'#(schemaVal)'
#"""
Scenario: To get all employees information in JSON format
And url 'https://jsonplaceholder.typicode.com/posts/1/comments'
When method get
Then status 200
And def schemaVal = {"postId": '#number',"id": '#number', "name": '#string',"email": '#string',"body": '#string'}
Then match response ==
"""
'#[] #(schemaVal)'
"""
@wilson1
Scenario: Title of your scenario
Given url 'https://gorest.co.in/public/v2/users'
When method get
Then def outputData = []
#Then print response[0]
And eval for(var i=0; i<response.length; i++) if(response[i].name.endsWith("Butt")) outputData.push(response[i].email)
Then print outputData
Explore conditional statements and for loops in Karate framework to filter API responses by name, extract emails and other fields, and print results using def and eval.
Leverage the Karate framework to compare input email data against API responses, using get requests, looping through data sets, and validating emails via a cucumber feature.
Read data from a customized Java class and use it in a karate feature file by creating a Java reader, instantiating it in karate, and applying the returned values.
Explore using the Karate framework to write api responses or ui data to text files with karate.write, creating mail_details.txt and validating content against the ui.
#Feature: Execute Java Script Function
#Scenario: validate js code 1
#Then def getValue = function() { return "surendra"; }
#Then print "function outpiut is ", getValue()
#Scenario: Function to add 2 numbers
#Then def sumValue = function(a,b) { return a+b; }
#Then def sumValue = function(a,b) { return a-b; }
#Then print "sum value os " , sumValue(100,150)
#Then print "sum value os " , sumValue(100,10)
#Scenario: Random Number
#Then def random = function() { return Math.random(); }
#Then print "random no is ", random()
Configure parallel execution in karate, specifying feature locations and parameters for each scenario. Set environment, tags, reports, and the parallel count for the test descriptor.
Learn how to convert a scenario into a scenario outline for post requests, substituting name, salary, and age inputs at run time to insert data into an API.
Learn to read data from a csv (csp) file in Karate by creating a csv with first name, last name, mobile, and address, then using read to load it.
Learn to read data from a CSP file for API requests in Karate framework, using scenario outlines or external data, create and access CSP data, and run multiple scenarios.
Feature: Demo
Scenario: To get specific employee details
Given url 'https://dummy.restapiexample.com'
And path '/api/v1/employee/1'
And header Accept = 'application/json'
When method get
Then status 200
Given def expected_Response_Data = read("/ApplicationResponse.json")
#Then print expected_Response_Data
Then match response == expected_Response_Data
Scenario: To get all employees information in JSON format
Given url 'https://thetestrequest.com/authors.xml'
And header Accept = 'application/xml'
When method get
Then status 200
Given def expected_Response_Data = read("/ResponseData.xml")
#Then print expected_Response_Data
Then match response == expected_Response_Data
Scenario: To POST an entry
Given url 'https://reqres.in/api/users'
And header Accept = 'application/json'
Then def input_json_body = read("/inputData.json")
Then request input_json_body
When method post
Then status 201
Create a testing ground for API testing by signing up with email registration, configuring a Learn by yourself stream site, and launching a scrum project to access API token information.
.Overview on JIRA user API, capturing JIRA account id , generating access token & converting curl command into a postman
Learn to implement basic authorization in the Karate framework by configuring a get request to retrieve user details, supplying username and password from Postman, and validating a 200 response.
Implement oauth authentication by building a Java method that retrieves a Salesforce access token via password grant using client id, client secret, username, and password, then use a bearer header.
Demonstrates posting a new user to the Jira API using basic authentication. Craft the JSON body and headers, and verify a 201 created response.
Feature: Validate File uploading flows
#Scenario: To POST an entry using expressions
#Given url 'https://chinnapavanm.atlassian.net/rest/api/3/issue/SCRUM-4/attachments'
#And header X-Atlassian-Token = 'no-check'
#Then header Authorization = call read('basic-auth.js') { username: 'chinnapavanm@gmail.com', password: 'ATATT3xFfGF0YQhLo-aH0Trjmg9kKyOBRMtVm-XXjuvVbTRJKBnElzEK-Piy15ISv0eUKbLyzh-tGdM9IxTCVgw8db0TmyANCbLviW6nPVH1jBUlvUXD-Taz_reudDCRwksq-EbwDWm-7d-Geab3DyW0_iY3xqFI_s6KUuzBQD3ZEHvYzZ7F08w=CE46325B' }
#Then multipart file file = { read: 'ApplicationResponse.json', filename: 'ApplicationResponse.json', Content-Type: 'multipart/form-data' }
#When method post
#Then status 200
Scenario: To POST an entry using expressions
Given url 'https://chinnapavanm.atlassian.net/rest/api/3/issue/SCRUM-4/attachments'
And header X-Atlassian-Token = 'no-check'
Then def fileLocation = '/data/README2.txt'
Then header Authorization = call read('basic-auth.js') { username: 'chinnapavanm@gmail.com', password: 'ATATT3xFfGF0YQhLo-aH0Trjmg9kKyOBRMtVm-XXjuvVbTRJKBnElzEK-Piy15ISv0eUKbLyzh-tGdM9IxTCVgw8db0TmyANCbLviW6nPVH1jBUlvUXD-Taz_reudDCRwksq-EbwDWm-7d-Geab3DyW0_iY3xqFI_s6KUuzBQD3ZEHvYzZ7F08w=CE46325B' }
Then multipart file file = { read: '#(fileLocation)', filename: 'README2.txt', Content-Type: 'multipart/form-data' }
When method post
Then status 200
Read test data from a CSV file and drive a POST API test by converting it to a scenario outline, then create multiple user entries and observe the results.
Learn to create a Karate config file, pull environment-specific data at runtime, and pass parameters to scenarios, enabling dynamic data substitution and environment-aware test execution.
Learn to read data from the karate config file and use environment values to substitute EMV in scenarios, updating the character configuration for environment specific parameters.
Learn to use karate.jsonPath in the karate framework to validate and extract data from JSON responses, using dollar for the full response, array indexing, and expression filters.
Refer below link which has examples what we discussed in the session:
https://github.com/json-path/JsonPath
Update and pass environment variables in the Karate runner class by using Karate data and environment parameters, run metadata, and a targeted environment value to publish changes during tests.
reference link for the topics which we discussed in this lecture : https://github.com/karatelabs/karate#command-line
Learn how to install and run Jenkins, configure global tools, create a freestyle project, set a custom workspace, and trigger Maven-based builds from the Jenkins console to automate test execution.
Scenario: To get all author information in xml format
Given url 'https://thetestrequest.com/authors.xml'
And header Accept = 'application/xml'
When method get
Then status 200
#And match response/objects/object[1]/email == 'viva@keebler.biz'
And match /objects/object[1]/email == 'viva@keebler.biz'
Scenario: To get author information in xml format
Given url 'https://thetestrequest.com/authors/1.xml'
And header Accept = 'application/xml'
When method get
Then status 200
And match response/hash/name == 'Karl Zboncak'
Explore hooks in the Karate framework to run preconditions before each scenario, using background, and postconditions after each scenario.
Explore karate ui automation, using cucumber feature files with Gherkin syntax and no programming language required, powered by Selenium with a W3C protocol, supporting parallel execution and visual testing.
Configure the karate framework in Eclipse by installing Java 8 or above, Maven, and cucumber plugin, then create a Maven karate ui project with karate core 0.96 and junit4 dependencies.
Identify and interact with browser UI elements using Karate locators and attributes to automate web tasks, covering id, name, hash selectors, and input actions across browsers.
Explore karate locators by hands-on examples of CSS selectors and XPath, convert between them, and simulate login operations using id-based, text-based, and data-test locators.
Learn karate wildcard locators to identify elements by exact or partial text, using tag names, first or indexed matches, and parent-child patterns to perform clicks in web automation.
Master friendly locators in the karate framework by using above, below, left, and right to identify username and password inputs relative to labels in a Salesforce login.
Master karate locators, including near, above, below, left, and right, and see how inputs are identified by default. Apply examples that fill fields and click actions in UI tests.
Retrieve the current web page URL and title with Karate's driver.url and driver.title, and print them to the console. Verify the URL and title using matches.
Learn to get and set web page dimensions with driver.dimensions and to read an object's position (x, y, width, height), with results printed as JSON to the console.
Learn to capture screenshots with the Karate framework: full-page, element-specific, and on-failure captures using after-scenario hooks, karate.info, and writing screenshots to a file.
Explore keyboard automation in karate framework using keys dot, enter, and tab, and learn to highlight, focus, and clear fields while understanding submit versus click for reliable UI actions.
Learn to handle dropdowns in Karate framework for UI automation, using select by index, value, full text, and partial text with locators and sample demonstrations.
Demonstrates automating dropdowns in a Salesforce signup flow: locate inputs, enter name and email, and select by index, value, visible text, or partial text, with synchronization delays.
Learn to handle alerts in web apps with the karate framework, covering simple alerts, prompts, and dialogs. Use driver.dialog to retrieve alert text, and to accept, cancel, or enter values.
Learn to retrieve text, get attributes and values, and switch between windows in Karate framework using text, attribute, and value commands, by title, index, or URL.
Upload a file via the input file method with a locator, then scroll to a target object and validate the upload with a confirmation message.
Rerun failed scenarios automatically by using an after-scenario hook to call a feature file when an error occurs, instead of capturing a screenshot, and validate errors before retrying.
Learn to run only specific Karate API and UI automation scenarios by tagging them, passing Karate options in the runner class, and executing only those tagged scenarios.
Scenario: Verify images
#Given compareImage { baseline: 'Image 1.jpeg', latest: 'Image 1.jpeg' }
Given def latestImgBytes = karate.readAsBytes('Image 1.jpeg')
When compareImage { baseline: 'Image 1.jpeg', latest: '#(latestImgBytes)' }
Discover how to perform API performance testing with Gatling using Karate tests, reuse your existing Karate code, and validate response times and codes under load.
Configure karate Gatling by creating a maven project, adding the Gatling and scala plugins, and wiring dependencies in pom.xml, using Visual Studio Code for performance testing.
Continue configuring gatling with karate by setting up a performance folder, moving a performance feature, updating pom.xml to gatling plugin 4.2.1, and organizing simulation, config, and data folders.
Create a Gatling runner extending simulation that wires Gatling to the karate protocol to run a demo performance feature with a 10-user, 5-second ramp.
Learn how karate protocol configuration consolidates multiple http get requests into a single gatling report. Assign a null id to the dynamic value so get-by-id requests aggregate into one output.
Learn how karate's name resolver customizes request naming via the karate name header, while returning null by default until the header activates a customized name.
this lecture demonstrates karate protocol pauseFor() by configuring delays per url pattern in milliseconds for get requests, using a 10 second delay across scenarios to show request timing.
Learn how to simulate user think time in karate with the karate.pass method instead of thread.sleep to avoid blocking, and see a 10-second delay example across two scenarios.
Explore the optional karate runner and how to configure environments with karate.env. Learn to use a config dir and config.js in src/test/resources/config, set dev base URLs, and apply system properties.
Explore the karate data feature and learn to tag individual scenarios in a feature file, then run only the tagged scenarios (like regression), and review the resulting reports.
Learn to use the ignore tag in karateFeature to skip regression scenarios, and combine comma separated tags like smoke and e2e for flexible, either/or test execution.
Learn to access and print Gatling session attributes in karate, including user id, token, and role, using GitHub Copilot to build practical feature file examples and inspect session data.
Learn how to use a feeder to inject csv data into karate gatling tests and print session fields like email id and username.
Explore Gatling feeder strategies for reading CSV data, including circular, random, and shuffle, with practical examples showing data iteration, handling multiple users, and common path issues.
Explore how to configure a json feeder in Gatling, load data from a json file, define an array of records, and print email and password during a scenario.
Learn how to simulate load with Gatling using open workload models, comparing open and closed models, and control arrival rate and concurrent users through at once injections and durations.
Explore an open model injection in the karate framework for performance testing, ramping up users per second from five to ten over several seconds and analyzing per-second requests.
Guide to using the Karate framework to create a dashboard via a post request, define a json payload and endpoint, and validate responses with postman and curl.
Add a gadget to a dashboard via curl and postman, updating the uri, dashboard id, and permissions to achieve a successful 200 response and visible gadget.
Learn to delete a gadget from a dashboard using the API with curl and postman, by supplying the dashboard ID and gadget ID. Confirm a 204 response and verify removal.
Update a dashboard (id A10037) using put requests via curl or postman, modify the description and name, and verify changes by retrieving all dashboards.
Feature: Verifying end points as per the request
#Scenario: Verify country codes
#Given url 'https://restcountries.com/v3.1/alpha/GB'
#When method get
#Then status 200
#Then print response[0].capital[0]
#And match response[0].capital[0] == 'London'
Scenario Outline: Verify country codes
Given url 'https://restcountries.com/v3.1/alpha/<code>'
When method get
Then status 200
#Then print response[0].capital[0]
And match response[0].capital[0] == '<country>'
Examples:
|code|country|
|GB |London |
|FR |Paris |
|JP |Tokyo |
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit5</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-core -->
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-core</artifactId>
<version>1.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-apache -->
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>0.9.6</version>
<scope>test</scope>
</dependency>
Explore artificial intelligence as computer systems that think and learn like humans, process data, and perform tasks such as writing text, recognizing images, and answering questions.
Explain what a large language model is, a human-brain-like AI trained on vast data to translate, answer, summarize, and generate images.
Explore how generative AI creates new content—code, documents, images, audio, and video—unlike traditional AI, which analyzes and retrieves existing data.
Explore memory concepts in AI, comparing short term and long term memory with examples like chatbot interactions and session persistence.
Explore the model context protocol (MCP), a universal adapter that standardizes how AI models call external tools, enabling reusable, scalable, and consistent integrations.
Understand human in the loop for AI decisions, guardrails to prevent harm, and how prompts curb hallucination in critical tasks.
Explore fine tuning of AI agents by updating the existing knowledge base to tailor interactions with customers, staff, and officials, contrasting it with rag and external knowledge.
Learn how providing context improves LMS outputs by guiding language models with precise information, boosting accuracy, and producing focused, relevant results.
Learn the fundamentals of prompts and prompt engineering, and how clear context and precise input guide AI responses, reduce hallucinations, and generate actionable plans like travel bookings.
Define and control context for LLM-driven testing by setting role-based rules, avoiding hallucination, and generating manual or automation test cases from user stories, acceptance criteria, and UI mockups.
Explore zero-shot, one-shot, few-shot, and chain-of-thought prompts and their role in automation testing and framework design. Emphasize clear instructions and context files to improve LLM outputs.
Compare ChatGPT, Copilot, and Cursor AI as general purpose AI versus coding assistants. Copilot and Cursor integrate with IDEs to generate framework-aligned code for automation testing; ChatGPT lacks repository awareness.
Explore AI models as data-trained algorithms, from GPT-style text generation to dalle-e image recognition, and see how LLMs are specialized tools within the broader AI toolbox.
Build an n8n workflow that reads data from Google Drive and Google Sheets via an AI agent, filters for Sam, and sends an email when matched.
Create and test an n8n workflow that reads data from a Google Sheet, checks for an email value, and sends a message to the matched address using an AI-assisted prompt.
Extend an n8n workflow by reading data from Google Sheets (sheet two) and sending emails when status is S, initiating background verification for multiple employees via an AI agent.
Create a Jira cloud account and configure a project with Zephyr test management for test case and defect creation. Generate API tokens, manage authentication, and integrate plugins for testing workflow.
Learn to build an n8n workflow that reads defect data from a sheet and creates Zira issues in a scrum-based project, including configuring credentials and troubleshooting connections.
Use an n8n workflow to automatically create Jira issues from new defects in the Lucky Trainings project, parsing status new and generating bug entries with automated summaries.
Learn to build a Chrome extension that records and plays back browser actions, with Cursor AI generating Playwright or Selenium scripts and auto-creating project files through an AI-powered workflow.
Learn to create a Chrome extension for record and playback with cursor AI, generate Playwright TypeScript or Selenium scripts, and download test scripts for automated browser actions.
Create an OTP shield mobile app that monitors text messages, phone calls, and WhatsApp activity, warns against sharing OTPs, and blocks APK files; guide through tool setup and APK generation.
Explore gpt for all, an open source desktop ai ecosystem that runs llms locally offline on Windows, Mac, and Linux, enabling private queries and test case generation from local docs.
Generate karate API tests with Copilot in Eclipse by defining a clear context, producing karate feature files with given-when-then steps, and configuring proper headers and authentication.
Create Karate API test cases using Copilot in VSCode editor by generating a create user feature, authenticating requests, and validating responses with curl commands and API context.
Load the project with cursor ai to generate a karate api test for get user email, treating ai as a time-saving helper, not a substitute.
Generate karate UI test cases in Eclipse Editor using Copilot, emphasizing accurate UI locators, given-when-then syntax, unique test names, and descriptive test descriptions across UI flows.
Generate a Karate UI test case using Cursor AI by analyzing the application, capturing locators, and creating a UI feature file for the login button on the home page.
Create local agents with agent.md and skills.md to define behavior and skills, enabling manual test case generation and automation script creation from Azure or Zira.
Create an Azure dev apps free account, set up an organization and project, and configure a pipeline to run playwright tests.
Design a manual test case generator sub-agent that fetches Azure DevOps user stories, generates and saves functional test cases as drafts, and optionally uploads them to Azure.
Create a manual test case generator agent that fetches user story details from azure dev apps, prints title, description, and acceptance criteria, and stores UI mockups for test generation.
** Complete Karate Framework course: API + UI + Performance (Gatling) + AI **
Learn the complete Karate Framework path — REST API automation, browser UI automation, Gatling performance testing, mini projects, and AI-driven Karate implementation.
This Karate API, UI and performance testing course is built for manual testers, beginners, and QA engineers who want one complete Karate learning path instead of separate tools.
What you will learn in this course:
- Karate Framework and Karate DSL fundamentals
- REST API automation with powerful assertions and data-driven tests
- Karate UI / browser automation for end-to-end flows
- Performance testing with Karate and Gatling
- Karate API mini project practice (JIRA workflows)
- Reusable scenarios and maintainable automation design
- AI-driven implementation concepts for Karate
- Practical skills for projects and interviews
Keywords covered in this course:
Karate Framework, Karate DSL, Karate API testing, Karate UI automation, Karate performance testing, Gatling with Karate, REST API automation, end to end automation, API UI performance testing, Karate from scratch, AI for QA.
This course combines Karate API, UI, and Gatling performance testing so you can build full-stack Karate automation skills for real projects and interviews.
If you are searching for Karate Framework, Karate API UI performance, Karate DSL, or complete Karate automation training in one course, this course is for you.