jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <>
Subject Re: BSF Scripts and User Defined Variables
Date Thu, 16 Jul 2009 18:06:15 GMT
In the documentation
RANDOM_NAME is a variable whose value is the actual script contents that you
wish to run. (i.e. the code itself)
If your sampler is working fine , why not just do


On Thu, Jul 16, 2009 at 10:59 AM, S.D. <> wrote:

> Hello.
> I am a little confused by how to use the BSF Sampler.  I'm hoping
> someone can assist. I'm either misunderstanding the documentation or am
> just not setting it up correctly.
> I have a BSF Sampler that is attached to a groovy script file. The
> sampler runs fine and I see the response.
> I want to capture this response and include it in the Http header with
> my test case.
> I'm not sure how this is supposed to work.  I have a UDV, titled "GUID"
> and its set to ${__BeanShell(${RANDOM_NAME})}."  In my Http Headers, I
> have a header that is set to ${GUID} but I always see the full string:
> ${__BeanShell(${RANDOM_NAME})}.
> In the JMeter doc, it states:
> "Once the script is working properly, it can be stored as a variable on
> the Test Plan. The script variable can then be used to create the
> function call. For example, suppose a BeanShell script is stored in the
> variable RANDOM_NAME. The function call can then be coded as
> ${__BeanShell(${RANDOM_NAME})}."
> What is RANDOM_NAME ?  The name of the groovy script file?  Is there a
> particular way I need to structure my script?  Does it only work for
> BeanShell scripts (.bsh) ?  Is the name a filename or something else?
> Does it have to be a PreProcessor or PostProcessor or Assertion?
> Any assistance is much appreciated.
> Thanks,
> --sidd
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message