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 to combine API test-automation, mocks, performance-testing and UI automation into a single, unified framework. The BDD syntax popularized by Cucumber is language-neutral, and 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 not comfortable with Java. Just write tests in a simple, readable syntax - carefully designed for HTTP, JSON, GraphQL and XML.

2626 questions
9
votes
2 answers

Using karate-config parameters in a feature file

The karate header examples do not show how to access config values other than baseUrl. When I switch environments (passing in -Dkarate.env=qual as part of the run command) then baseUrl is set correctly. The problem is, I want to use other config…
roblogic
  • 1,146
  • 2
  • 12
  • 20
8
votes
1 answer

In Karate how we can collaboratively work along with BA to automate business scenarios

While using Karate we were able to do most of the validations for web services, we were able to successfully integrate Karate with Selenium webdriver and do DB assertions using java classes. For DB we returned the results sets as list by converting…
Sree
  • 301
  • 3
  • 11
6
votes
2 answers

Printing to console not working in Karate

I have scenario which tests an Micro service. Scenario Outline: Run Object Queries Scenario Outline: Run Object Queries Given url homeLinks.queryUrl And header Content-Type = 'application/x-www-form-urlencoded' When method post …
Santosh Hegde
  • 2,520
  • 7
  • 25
  • 42
6
votes
2 answers

Karate karate-config.js not a js function

I'm trying use karate for e2e tests and have started with a minimal setup. I want to create some config items in karate-config.js for use in the tests but karate is reporting that file is not a js function and hence the test fails trying to get the…
Shane Rowatt
  • 1,570
  • 18
  • 39
6
votes
1 answer

Karate Gatling with gradle build is not working

I am trying to run gatling with karate in gradle build and getting below error, /smoketests/SmokeTestRunner.java:19: error: package org.junit.runner does not exist import org.junit.runner.RunWith; …
Manoj Mishra
  • 117
  • 5
6
votes
2 answers

How to use if condition in Karate

Suppose I have the following Json response [ { id: 1, name: "John", password: "JohnsPassword54", }, { id: 2, name: "David", password: "DavidsPassword24", } ] Then how can I extract the…
Amir Ghahrai
  • 598
  • 1
  • 6
  • 21
5
votes
2 answers

Disable Chrome Password Manager through Karate framework

Trying to pick up the right combination of chrome options to disable annoying Password Manager popup after passing login form. Here is how I create a driver: Feature: Driver initialization Background: * configure retry = { count: 5,…
Dmitry
  • 73
  • 1
  • 4
5
votes
2 answers

Karate Runner hangs at waiting for parallel features to complete

I am trying to execute some tests using Karate Runner - @KarateOptions(tags = {"~@ignore"}) //@KarateOptions(features = "examples/test.feature") public class KarateTestRunner { @BeforeClass public static void beforeClass() throws Exception…
ysn
  • 69
  • 4
5
votes
1 answer

Create tests jar with all the Karate dependencies

I have the following project structure. src/test/java There is no src/main folder. Above src/test/java folder contains some scala classes as well as some java classes. When i build the jar file using following plugins maven-jar-plugin : it…
5
votes
1 answer

[karate][standalone] Error : could not find or read file

I am only using the latest standalone karate jar to test my API on a docker container configured with JRE and I don't have any Java code. Currently on one of my features, i have this : read('file.json'), and it works fine when the resource file is…
rfjg
  • 115
  • 2
  • 8
5
votes
2 answers

Retry mechanism in karate testing framework

Retry mechanism in karate testing framework How to retry tests on failure in karate testing framework like Junit and TestNG. something like public class Retry implements IRetryAnalyzer { private int count = 0; private static int maxTry =…
Rahul R
  • 125
  • 2
  • 7
5
votes
1 answer

Karate - How to delay all scenarios?

I have a 10 scenarios, all of them must have 1 min delay after executing background. I call my delay function in background. The problem is that all scenarios call background, and I have to wait 10 minutes. Is there a way to call my wait function…
ehsan shirzadi
  • 4,138
  • 12
  • 57
  • 99
5
votes
2 answers

Pass additional parameters to karate-config.js via command line via Maven

I have additional settings that I need to pass to Karate when running via Maven that will be available in karate-config.js. Currently I can pass in a string using the karate.env property - is it necessary to encode my parameters as a JSON object and…
Dunc
  • 63
  • 1
  • 3
5
votes
1 answer

Is there a mechanism for integration testing JAX-RS services without deploying (a la MockMVC)?

I have successfully built no-deployment-needed integration test frameworks for Spring MVC REST services using Mock MVC. I am struggling to do the same with JAX-RS services. REST Assured looks promising, but it seems to require deployment. The test…
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
1
2 3
99 100