You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Nirodha Pramod <ni...@wso2.com> on 2012/01/31 01:44:47 UTC

Can we run a BeanShell PP only once in a thread

Hi,

I have a requirement to read a jmeter property and extract some values out
of that. To explain more my property is 'csv.variables' = "var1,var2,var3"
(which has a string of comma separated values). So what I want to do is
read the property value and separate the var1,var2....... values out of
that string, inside a beanshell pp and use them as variable names in
jmeter. So is there a way that I can execute the Bshell only once to read
those values. Other wise executing that java code in each thread will give
a performance hit. Does anyone have any idea on how do it in a better way.

Thanks,
Nirodha



-- 
*Nirodha Gallage*
Software Engineer, QA.
WSO2 Inc.: http://wso2.com/
Email: nirodha@wso2.com   Mobile: +94716429078

Re: Can we run a BeanShell PP only once in a thread

Posted by sebb <se...@gmail.com>.
On 31 January 2012 00:44, Nirodha Pramod <ni...@wso2.com> wrote:
> Hi,
>
> I have a requirement to read a jmeter property and extract some values out
> of that. To explain more my property is 'csv.variables' = "var1,var2,var3"
> (which has a string of comma separated values). So what I want to do is
> read the property value and separate the var1,var2....... values out of
> that string, inside a beanshell pp and use them as variable names in
> jmeter. So is there a way that I can execute the Bshell only once to read
> those values. Other wise executing that java code in each thread will give
> a performance hit. Does anyone have any idea on how do it in a better way.

Yes; any one of:

Use a setUp thread group
Use a once-only controller
Use a beanshell function to do it on the Test Plan

Of course if you allow the use of something other than BeanShell:

Use the __split function to do it on the Test Plan
Use CSV Dataset Config to read the data from a file instead

Not forgetting: provide the property ready-split

> Thanks,
> Nirodha
>
>
>
> --
> *Nirodha Gallage*
> Software Engineer, QA.
> WSO2 Inc.: http://wso2.com/
> Email: nirodha@wso2.com   Mobile: +94716429078

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