Add expectations and extract values

Decide when a step passes and carry a value from one step into the next.

In short

Each step of a suite is judged by its request's checks until you give it expectations of its own. An extract rule reads a value from one step's answer into a variable that later steps use.

Before you start

Steps

  1. Open the suite and the step.
  2. Choose an expectation (see the table). Choose "Same as the request's checks" to follow the request again.
  3. Add any further checks; they are listed under "Also checks".
  1. Press "Extract a value" and set the rule: a JSON path such as $.data.id against the body, or a header name.
  2. Use it in later steps as {{variable}} in the URL, headers, parameters or body.

Result: the step passes or fails by its own expectation, and later steps get the value.

Good to know

If something goes wrong

Related