0
votes

I just did a quick test to run jmeter using Ant. I see an html report that shows success rate based on HTTP status codes:

Ant Jmeter Report

Is it possible to do anything so that say, requests that take more than 1 second are considered as failures too?

So in short I want the report to show failure when the HTTP code is not 2XX and also when response time greater than say 1 sec

Thanks!

2

2 Answers

1
votes
  1. In order to check HTTP Status code being 2xx add a Response Assertion to the Sampler(s) which you want to have checked (JMeter Assertions respect JMeter Scoping Rules) and configure it like:

    enter image description here

  2. In order to conditionally fail requests which take longer than 1 second add Duration Assertion (the same Scoping Rules apply) and configure it like:

    enter image description here

Check out How to Use JMeter Assertions in Three Easy Steps article to learn more how you can conditionally mark JMeter samplers as passed/failed using Assertions.

0
votes

Add to your test Duration Assertion with value of 1000 (Milliseconds)

Duration in Milliseconds The maximum number of milliseconds each response is allowed before being marked as failed.