Testing / Karate Framework Interview questions
What is the configure keyword used for in Karate?
configure sets runtime behavior for the HTTP client and other engine settings, either globally in karate-config.js or scoped to a single feature or scenario. Common uses include setting default headers, timeouts, SSL behavior, and retry settings.
* configure headers = { Accept: 'application/json' } * configure connectTimeout = 5000 * configure readTimeout = 10000 * configure ssl = true * configure retry = { count: 3, interval: 2000 }
Settings applied via configure inside a specific feature or scenario override whatever was set globally in karate-config.js for the duration of that scope, which lets most tests rely on sensible shared defaults while individual scenarios override just the specific setting they need, like a longer timeout for one known-slow endpoint.
More Related questions...