jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Gandt <>
Subject beanshell and Aggregate Graph, recording errors not working
Date Tue, 10 May 2011 13:54:51 GMT
I have a beanshell that I'm running using the "BeanShell Sampler", it looks


// auto assume that the updfate failed, therefore if anything goes wrong and
we exit for some reason it will have failed
vars.put("IsSuccess", "false");   
vars.put("ResponseMessage", "NOT OK");

// Article Asset creation object
CreateArticleAsset CAA = new CreateArticleAsset("http://" + bsh.args[0] +
":" + bsh.args[1] + "/" + bsh.args[2]);

String responsecode = CAA.editAsset(bsh.args[3]);

//enable for debugging only
print (responsecode);

// return the response code
vars.put("ResponseCode", responsecode);

// last check if wwe got a 200 back if so then and only then are we
successful at updating
if(responsecode.compareTo("200")  == 0) {
    vars.put("IsSuccess", "true");   
    vars.put("ResponseMessage", "OK");

//always return the response code
return responsecode;

Now the code executed always returns 200 or 404, yet even when a 404 is
returned and thus IsSuccess is set to "false" and ResponseMessage is "Not
OK" and the ResponseCode is "404" the Aggregate graph still records the run
as successful, which makes monitoring it worthless, as I need to know when
it works and when it fails.

Another related question if a BeanShell script exits, why does jmeter also


View this message in context:
Sent from the JMeter - User mailing list archive at

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

View raw message