jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
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 <lyle.ryan@cubic.com> 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
error.

There may be other approaches.

>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/exiting-with-an-error-return-code-on-when-Assertion-Test-fails-tp5715096.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message