Questions tagged [karate]

Use for questions regarding Karate, an open-source tool that combines API test-automation, mocks, performance-testing and UI automation - into a single, unified framework.

Karate is the only open-source tool that combines API test-automation, mocks, performance-testing and UI automation into a single, unified framework.

Karate uses a language-neutral BDD syntax, which is easy for even non-programmers. Besides powerful JSON & XML assertions, you can run tests in parallel for speed - which is critical for HTTP API testing.

You can easily build (or re-use) complex request payloads, and dynamically construct more requests from response data. The payload and schema validation engine can perform a 'smart compare' (deep-equals) of two JSON or XML documents, and you can even ignore dynamic values where needed.

Test execution and report generation feels like any standard Java project. But there's also a stand-alone executable for teams that are not comfortable with Java. Just write tests in a simple, readable syntax - carefully designed for HTTP, JSON, GraphQL and XML.

4221 questions
4
votes
1 answer

gatling report can't be generated

With a recent change to our codebase we're starting to get the following error. Caused by: java.lang.UnsupportedOperationException: There were no requests sent during the simulation, reports won't be generated We changed nothing with our gatling…
MaartenCl
  • 41
  • 1
4
votes
1 answer

how to load more requests per second in karate gatling

I am trying to reuse karate scripts and perform load testing using gatling. The scenario defined is to load constant 50 users per second for 10 seconds. (To load test 500 users) However the number of requests per second does not exceed 20 requests…
Vijay Reddy
  • 97
  • 1
  • 8
4
votes
1 answer

Can we add more than one statement in an 'If' statement in Karate?

I want to execute more than 1 statements provided an If condition is true. I want to know whether and how is it achievable in Intuit Karate framework. In the Karate documentation, I find examples like below all of which have only one statement to be…
Gautam Das
  • 41
  • 2
4
votes
2 answers

Karate: Call the same feature file with multiple url paths

I need to run the tests in a feature file with multiple endpoint urls. All the tests hit REST endpoints and I need to hit multiple endpoints for the same tests. I came up with the two below working solutions, but they both have maintenance overhead.…
4
votes
2 answers

How to collect code coverage with Istanbul when executing HTTP endpoints via Postman or Karate

I have a JS project that provides a set of endpoints leveraging Express with a typical express/router pattern. const express = require('express'); const router = new express.Router(); router.post('/', async (req, res, next) => {…
Captain Kirk
  • 350
  • 6
  • 24
4
votes
1 answer

How to use gherkin localization in Karate framework?

I want to use gherkin localization in Karate Framework. English version of scenario works perfect. But with Russian version it looks like Karate FeatureParser doesn't know localized tags and fails. Here is the error log: line 15:0 mismatched input…
ZeAL0T
  • 709
  • 1
  • 12
  • 27
4
votes
2 answers

is it possible to extract the value of one of the key value pairs in request to be asserted

peter had provided me a solution to use karate 0.9.3 to apply assertion from examples Trying to do some assertion from request, which will be present in response i was wondering if it is possible to assert a value from request instead of full…
Sadiq K
  • 192
  • 8
4
votes
2 answers

karate : How to set the Json value if object name contains period in an array

Here is my JSON request example code and as u can see #(Paramtervale) as to be replaced by MyValue Below is the example of the request json and code: * request """ { "query": { "bool": { …
4
votes
2 answers

How to log all details (DEBUG level) only on failed REST API requests?

I get over 1 GB logs after each execution of functional tests if DEBUG level is set for all requests using the the following line in the logback-test.xml: And the logs are getting much bigger if…
beloyar
  • 247
  • 3
  • 11
4
votes
1 answer

Karate test cases are failing after updating to jdk version 1.8.0_111

I am unable to run my test cases.Below is my Configurations and IDE used - Maven: 3.6.0 JDK: 1.8.0_111 IDE: Intellij karate Version:0.9.0 Caused By com.intuit.karate - javascript function call failed: ReferenceError: "karate" is not defined.
Gaurav Kinra
  • 183
  • 6
  • 12
4
votes
1 answer

Karate: I would like to assert to match parts of response

Karate: I would like to assert to match parts of response I am getting the following response: 12:10:33.960 [print] Kyc Status changed from NotStarted to Accepted.Reason: Output Address AddressLine : 6927 14TH AVE But I would like to only make…
S Keleta
  • 77
  • 1
  • 5
4
votes
1 answer

Karate + Appium, command driver.startRecordingScreen() is not working

There is a problem with sending startRecordingScreen() command with Karate to Appium server. I tried to send command with curl and it works, but with in Karate scenario it's failed. No any logs on Appium server console Feature: Simple test with…
Yury
  • 51
  • 4
4
votes
1 answer

Karate Framework : #notnull and #present are not working in case response is empty

My validation is to verify weather orgId appears in the response or not and that orgId should contain some value The response that i am getting is Status code 200 and response body is empty. Now I have below implementation Then match $.orgId ==…
Archit Goel
  • 63
  • 1
  • 2
  • 5
4
votes
1 answer

is it possible to overwrite parameters in a called feature file, which have been defined in background or scenario?

https://github.com/intuit/karate#calling-other-feature-files The link above contains an example of calling a feature file in order to reuse the code. The feature file which is reused is called with the inputs Background: * configure headers =…
Luke D.
  • 53
  • 6
4
votes
0 answers

How to get Karate Test code-coverage into the SonarQube using jacoco maven plugin in Spring boot?

I have a spring-boot project and I am writing test using Karate and using Java Code Coverage maven plugin to generate a code coverage report and using SonarQube. I also have 2 Unit test. I am able to generate Jacoco report for unit test and karate…