You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by memeMa <me...@gmail.com> on 2004/12/13 18:47:02 UTC

about beanshell sampler

Hi,

In my beanshell Sampler, I have:
------------------------------------------------------------------
Name:findVar
Parameters: ${login_counter}  <<<<thlis is my Jmeter variable
Script file:
Script:

SampleResult.setResponseMessage(bsh.args[0]+"hello");
print(SampleResult.getResponseMessage());
------------------------------------------------------

I use print to varify that I got what I expected, but my problem is
how can I make this responseMessage available to the rest of program?
like assign to a new variable? don't how?

ma

Re: about beanshell sampler

Posted by sebb <se...@gmail.com>.
What are you trying to do?

ResponseMessage is the text that corresponds with the ResponseCode -
is that what you intended? e.g. for an HTTP response of 200, it might
be "OK".

The BeanShell sample result is taken from the return value of the script - see:
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#BeanShell_Sampler
and as such is available to Assertions and Listeners etc in the normal way.


S.
On Mon, 13 Dec 2004 09:47:02 -0800, memeMa <me...@gmail.com> wrote:
> Hi,
> 
> In my beanshell Sampler, I have:
> ------------------------------------------------------------------
> Name:findVar
> Parameters: ${login_counter}  <<<<thlis is my Jmeter variable
> Script file:
> Script:
> 
> SampleResult.setResponseMessage(bsh.args[0]+"hello");
> print(SampleResult.getResponseMessage());
> ------------------------------------------------------
> 
> I use print to varify that I got what I expected, but my problem is
> how can I make this responseMessage available to the rest of program?
> like assign to a new variable? don't how?
> 
> ma
> 
>

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