S.D.
2009-07-16 17:59:38 UTC
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
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