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
2 answers

How to create a random string everytime a test runs in karate dsl

The json request I am sending is: Given url applicationURL And path 'applications' And header Authorization = subscribeToken And request: { "throttlingTier": "Unlimited", "description": "sample app description", "name":…
Sneha Shukla
  • 373
  • 1
  • 4
  • 19
4
votes
1 answer

Karate Extent Report integrtion

Karate -junit will provide Reports as BDD. We have new requirement to push this report to Report server KLOV(Extent Reports). Is this possible to with listener's? please let know the documentation. Integration Extent Report with Karate frame work.
rama
  • 75
  • 6
4
votes
1 answer

How to disable encoding while passing a form field in karate

I am using the following code for oauth. Feature: Verify Generate Token Email api is up and running Scenario: Verify Generate Token Email api Given url 'demourl' And header Content-Type =…
Ainesh Patidar
  • 189
  • 4
  • 13
4
votes
1 answer

Karate: passing dynamic parameter values via the command line not working

I am trying to pass a URL from the command line when I run karate integration tests on the command line. I took a look at this and tried to do the same thing but so far no luck. I have this karate-config.js file function karateconf() { …
rol sel
  • 43
  • 1
  • 4
4
votes
1 answer

NTLM authentication for REST api in Karate framework

Have anyone tried NTLM authentication implemented in Karate framework which i could refer? I get 401 authorization issue while I try building a test and pass header argument. @BeforeClass public static void before() { …
Sanu
  • 55
  • 3
4
votes
1 answer

Reading data from .properties file in Karate DSL

We are trying to co exist with another java project which uses Webdriver etc. As part of this we would like to re use the same .properties file that is being used by other project for our configuration etc. Could some one guide us on reading from…
yek
  • 127
  • 1
  • 7
4
votes
1 answer

Karate API Testing - How to use a variable (output from response) from API 1 to another API in same feature

I have a scenario : Call API - Capture Response - Get ID from response and call another API which takes input ID from response 1. Ex : Feature: test graphql end point Background: * url baseUrl + '/graphql' Scenario: Create Org Call …
Rahul R
  • 125
  • 3
  • 7
4
votes
1 answer

How do i selectively ignore certain .feature files in my build while using karate framework?

I have to ignore certain .feature test files for my integration test suite using karate framework. Is there any way in which i can selectively exclude certain files.
Shriram
  • 123
  • 2
  • 5
4
votes
2 answers

Karate - How to import json data

I want to import some JSON data to my tests. In order to documentation I should do that like this: * def data = read('classpath:init/data.json') I've created my JSON file with this content: { "name": "ehsan" } This is my code: Background: …
ehsan shirzadi
  • 4,709
  • 16
  • 69
  • 112
4
votes
2 answers

In Karate DSL, calling a javascript file returns java.lang.RuntimeException

I have a javascript file I want to call. contents are below. When I tried calling the file, I keep getting a "no variable found with name: response" even though there is clearly a variable defined. The file executes fine within command-line using…
Lincoln88
  • 213
  • 5
  • 19
4
votes
1 answer

Karate - How to call a function in a loop?

How to call my login function in a loop? Feature: Validate correct user login Background: * call read('classpath:cleanup.feature') * def login = call read('classpath:account/init/init.user.feature')
ehsan shirzadi
  • 4,709
  • 16
  • 69
  • 112
4
votes
1 answer

How to get a value (ex: baseURL) in every Karate feature?

I would like to get a common variable for all features. Ex: base URL and path (in some features). I don't understand well in Karate official tutos what to do exactly. I put in user.feature `Background: * url urlBase * path users In…
cygne
  • 527
  • 1
  • 10
  • 28
4
votes
1 answer

Karate API Testing - Reusing variables in different scenarios in the same feature file

Does Karate supports a feature where you can define a variable in a scenario and reuse it in other scenarios in the same feature file. I tried doing the same but get an error. What's the best way to reuse the variables within the same feature file…
Saurabh
  • 930
  • 2
  • 17
  • 39
4
votes
3 answers

Deploying microservice to be tested within the test

Maybe this is not possible to do generically in a test framework but I would like to be able to deploy the microservice I am testing within the test itself. I have looked at Citrus, RestAssured, and Karate and listened to countless talks and read…
4
votes
1 answer

Call failed after 702 milliseconds

I see the error below when I run my first script. com.intuit.karate.exception.KarateException: http call failed after 702 milliseconds for URL: https://qa.myorg.intVersion. Here is my feature file. Feature: Test feature Scenario: Verify my…
Chris
  • 236
  • 4
  • 14