On 18 October 2012 18:11, Lyle <[email protected]> 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: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
