effedici
effedici

Reputation: 207

JMeter failure resport

I want to set up some tests but cannot set up a summary report where I can see the failed tests.

Case 1 - correct assertions but an ambiguous report

Example: I want to check that the API response headers and body are correct for test-case with status=400.

Setup: an HTTP Request with one or more Response Assertions.

What I see in the Summary report: despite that all assertions were satisfied, the call has been tagged as an error (due to 400 status).

Case 2 - broken assertions but a clean report

If I flag "Ignore Status" in the Response Assertion, the 400 response is not tagged as an error but if the assertion about the error code is not matched, the Summary Report does not note the failure.

What I need

A report where is tracked how many tests failed based on (not satisfied) assertions and not on the HTTP status of the response. How can I get this?

Upvotes: 0

Views: 15

Answers (1)

Dmitri T
Dmitri T

Reputation: 168072

You will need to go for several Response Assertions

  1. Check that status code is 400 and don't mark the request as failed

    enter image description here

  2. Check that the response contains the anticipated text:

    enter image description here

In this case:

  1. First assertion will fail if the response code will differ from 400
  2. Second assertion will fail if some text which has to be present won't be found in the response

If the response code is 400 and some text which has to be present is found the sampler will be marked as passed.

More information: What Are JMeter Response Assertions?

Upvotes: 1

Related Questions