Skip to main content

Compare

Compare checks the request or the response of the case against a reference.

Preview of Compare in Case Editor
  1. Request Compare, compares the request of the case. It can be enabled or disabled by selecting its toggle.
  2. Response Compare, compares the response of the case. It can be enabled or disabled by selecting its toggle.

For each group, Compare selects the part to be compared: This case's response body or This case's response body + headers.

'Compare' row in Compare

Compare Against selects the reference: Expected Output, Variable, or both. Each reference runs independently and is reported separately. The compare group fails if either reference fails, and is blocked if either is blocked.

'Compare Against' in Compare

Comparing against an expected output requires the following fields:

Compare against expected output fields in Compare
  1. Match Mode, how the output should be matched. Exact requires the two sides to be identical, and an extra field on the compared side is a difference. Subset requires everything in the expected output must match, and extra fields on the compared side are allowed. Structure only requires only the structure to match.
  2. Expected Output, the reference document, in JSON. It may contain {{variables}} and {{data.1.column}}, resolved by the same rule as in Assertions. An unresolved variable makes the case Blocked.
  3. Array Order Matters, when enabled, arrays must match in order.
  4. Case Sensitive, when enabled, string comparison distinguishes upper and lower case.
  5. Numeric Tolerance, the permitted difference between two numbers. It is intended for differences caused by rounding.
  6. Ignore Fields, paths such as $.timestamp that are removed from both sides before comparison. Select + Add Path to add one.

Comparing against a variable requires the following fields:

Compare against a variable fields in Compare
  1. Variable, a capture from a dataset bound on Data.
  2. Match Mode, as described for expected output.
  3. Array Order Matters, as described for expected output.
  4. Case Sensitive, as described for expected output.
  5. Numeric Tolerance, as described for expected output.
  6. Ignore Fields, as described for expected output.

Changes take place only after clicking on Save.

'Save' button in Compare