Skip to content

Config Variables

Peter Thomas edited this page Feb 20, 2025 · 7 revisions

Config variables have the effect of changing global "behavior" and are identified by starting with xp., for example: xp.url.

Anything set this way will apply to all requests, unless you over-ride them. Any other variables will be treated as normal global variables.

Name Type Effect
xp.url string Default "base URL" for all requests
xp.headers json Sets headers for all requests
xp.cookies json Sets cookies for all requests
xp.ssl boolean / json Set this to (true) if you have to test HTTPS and the server is strict
xp.charset string null by default, set it to utf-8 to add charset=UTF-8 the Content-Type header
xp.followRedirects boolean Set this to (false) to not follow redirects by default
xp.connectTimeout number Increase the connect timeout which defaults to (30000) (30 seconds)
xp.readTimeout number Increase the read timeout which defaults to (30000) (30 seconds)
xp.proxy string / json The URI of the proxy server to use

For more details, you can also refer to the corresponding configure keys for Karate as Xplorer adopts similar conventions.

Those "config settings" that expect a JSON can also be a JS function that returns a JSON, allowing for some very dynamic behavior.

Clone this wiki locally