Anirudh Bagri
Anirudh Bagri

Reputation: 2447

Assert Result From Aggregate Report Jmeter

I am very new to Jmeter, I am using JMeter 5.1. I have an HTTP request with multiple Threads and Loops. After the result, I have an aggregate report which allows me to see Average of all response time, 90th Percentile, 99th percentile and other such metrics.

What I want to do is assert this result with what is expected. Basically, when I run this script in cli, it should fail (For eg.) if 90th percentile is greater than 2000ms, it should exit with a non-zero value.

I tried using JSR233/Beanshell Assertion, I am not sure how to get aggregate report variables' value (like 99th percentile) to the jsr233 script.

Currently, cli returns with 0 even if there is some error in the script (like 500 or 404).

Upvotes: 1

Views: 933

Answers (1)

Dmitri T
Dmitri T

Reputation: 168122

Unfortunately JMeter per se doesn't provide this functionality, the options are in:

  1. Integrate your build with Jenkins, this way you can have benefits of Jenkins Performance Plugin which can mark your build as unstable/failed depending on various criteria including Percentile static or relative thresholds

    enter image description here

  2. Use Taurus tool as the wrapper for your JMeter test. Taurus naturally supports JMeter so you won't have to do anything with your test and you will have the possibility to define custom Pass/Fail Criteria so Taurus will mark your test as failed, moreover it will provide non-zero exit code so your JMeter test will be more scripting/CI friendly.

Upvotes: 0

Related Questions