0

I know In general JMeter automatically treats samplers with HTTP Status Code above 400 as failed , but I am doing the security testing for the API's such as 403 forbidden.

Snice I expect 403 forbidden error, how do I make Report is PASSED for 403 forbidden error.

rpagadala
  • 796
  • 2
  • 15
  • 31
  • See my answer in https://stackoverflow.com/questions/59485324/handle-negative-cases-in-jmeter-for-example-my-expected-output-response-is-400/59485393#59485393 – Ori Marko Dec 13 '22 at 04:21

1 Answers1

0

You can check for HTTP 403 expected status code using Response Assertion configured as follows:

enter image description here

  1. It will suppress JMeter's automatic marking HTTP Status Codes above 400 as failed
  2. It will check whether response code is equal to 403 and fail the Sampler(s) in the Assertion's scope in the opposite case

More information: What Are JMeter Response Assertions?

Dmitri T
  • 159,985
  • 5
  • 83
  • 133