Hi, I used a JSR223 Listener as suggested.
And using JRuby as the script language, I typed: puts $sampleResult.get_response_message if not $sampleResult.is_successful? Many Thanks Paul On Fri, 23 May 2014, at 04:48 AM, [email protected] wrote: > Hi Sebb, > > Yes, I have tried it. > > I'll still get response messages of "OK" to the console. Which I assume > is thread race conditions. > > Paul > > On Fri, 23 May 2014, at 04:33 AM, sebb wrote: > > On 23 May 2014 11:31, <[email protected]> wrote: > > > Hi, > > > > > > I would like to log responses for non-200 HTTP status codes. > > > > > > In the Beanshell post-processor I have the code: > > > > > > if (prev.getResponseCode() != 200) { > > > print(prev.getResponseMessage()); > > > } > > > > > > But this is not going to work, because 'prev' is global and the state > > > can mutate within the conditional. > > > > Are you sure it does not work? > > Have you tried it? > > > > > Could you tell me what the best approach would be to log non-200 > > > response messages or errors? > > > > I would probably use a Listener, but I don't immediately see why the > > Post-Processor approach should not also work. > > > > > Thanks > > > > > > Paul > > > > > > > > > --------------------------------------------------------------------- > > > 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] > > > > --------------------------------------------------------------------- > 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]
