Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test an expected 404 response with JMeter

Tags:

jmeter

I want to create a JMeter test that will request a page that I expect to return a 404 and assert that that is in fact what is returned. Typically, JMeter will treat a 404 response as a failure for an assertion.

like image 639
Ariel Allon Avatar asked Jul 09 '15 12:07

Ariel Allon


1 Answers

Create a new Response Assertion under the test. In the "Response Field to Test" section of the assertion, make sure to check the box for "Ignore Status".

You can then add other assertions as you'd like, such as setting the radio in "Response Field to Test" to "Response Code" and setting the "Patterns to Test" to 404.

(h/t http://jmeter.512774.n5.nabble.com/Making-HTTP-404-a-test-success-tp5713923p5713941.html)

like image 143
Ariel Allon Avatar answered Sep 26 '22 11:09

Ariel Allon