jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: exiting with an error return code on when Assertion Test fails
Date Fri, 02 Nov 2012 20:41:42 GMT
On 18 October 2012 18:11, Lyle <> wrote:
> I am using JMeter in command-line mode on Solaris, not for load-testing, but
> for functional testing a website. In the name of writing a Nagios plug-in to
> monitor the website, I need the JMeter to exit with an error return code if
> an Assertion Test fails.
> So I've got a Sampler with an Assertion Test child.  I'm guessing I have to
> somehow determine if the Test failed, maybe do some post-processing to
> determine the text of the error, and exit with a specific error code.
> Any advice?  Thanks...Lyle

JMeter does not call System.exit(int) except when a serious error occurs.
This is to allow embedded usage.

I can think of two options:
1) write the sample results to a JTL file, and post-process that to
determine if the test succeeded or not.
2) write an Assertion element using Beanshell or BSF that invokes
System.exit() with non-zero code. JMeter uses exit(1) for severe

There may be other approaches.

> --
> View this message in context:
> Sent from the JMeter - User mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message