API interaction

API interaction

This interaction enables you to perform an API call to any endpoint. This call will be done again each time your test is run (for that reason, this endpoint should be idempotent).

You can use different HTTP verbs (GET, POST, DELETE, PATCH, PUT), headers and a body when relevant.

Use cases

This interaction shines when it comes to deal with user state management.

For instance, the most popular usage of this interaction among our customers is to call one of their backend route in the very first step to create a fresh user in a specific "state". The endpoint returns the credentials the subsequent steps will use to login.

For instance:

You will need to design your backend routes relevant to your test cases.

This way of managing user state management has many advantages:

  • having 1 single interaction instead of many to provision your account makes your test faster and easier to maintain
  • this logic is external to your app. You don't have to embed test specific lines of code in your app (bye bye secret menus and deeplinks). And you can even leverage those generic endpoints for manual testing, or other automated tests.

Use variables in the API call inputs

You can reuse a pre-existing variable, or create a new variable, on the fly.

It works in every input fields: URL, headers, body. Just type $ and follow the UI.

Please note that your body always has to be a valid json. In case it's not, our UI will tell you:

Store output values in variables

In addition, you can store any value returned in the (JSON) response into a variable โ€” for future use in your test scenario. Pre-existing variables are overridden; new variables are created on the fly. Each time the test is run, the variable will be set to the value returned by the endpoint.

๐Ÿšง

Beware variable overrides

if a variable with the same name already exists in your test, it will be overridden by the value from the API interaction output.

IP Whitelisting

All API Interactions will be performed from the static IP 54.188.80.90.