Stefio Kurniadi
Stefio Kurniadi

Reputation: 89

Jmeter two response code assertion

I already made Response Code 422 as a success http request in jmeter with Response Assertion, and it works. But jmeter assign Response Code 200 as a failed http request.

I add 422 and 200 in Pattern to test but jmeter only assert Response Code 200 as a success http request.

How assign Response Code 200 OR 422 as a success http request?

regards, Stefio

Upvotes: 2

Views: 6210

Answers (3)

user7982813
user7982813

Reputation: 151

You can also use a beanshell post processor to write a short beanshell script to change the status from "fail" to "pass" if the code is 422.

Upvotes: 0

Malay Shah
Malay Shah

Reputation: 1

Assert the text/Response code by using Response Assertion. Click here Image for solution.

Upvotes: -1

RaGe
RaGe

Reputation: 23677

200|422

The pipe character | is the OR operator

In general, you can use perl5 regular expressions in JMeter

Upvotes: 7

Related Questions