You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Philippe Bossu <pb...@gmail.com> on 2012/11/02 16:03:23 UTC

Best place to put function calls

Hello,
I was wondering what is the best place to put a function call in a JMeter
Test Plan.

I have the answer for:
 functions that will be used as variables in the rest of test plan, best
place would be User Defined Variables config element
functions which result is the value of a parameter, I would put them in the
parameter Value column of the Table

But for others that are not parameters of a sample or that build many
different variables ?

Let's say I want to:
split a String
log / logn
Is putting them in a Debug Sampler a good idea ? in which field name or
comment ?

Thank you for your help
Regards

Re: Best place to put function calls

Posted by Shaba K <sh...@gmail.com>.
@Philip ..

Am know lost as to, what exactly is your requirement ?

cheers,
s

On Sun, Nov 4, 2012 at 8:58 AM, Shmuel Krakower <sh...@gmail.com> wrote:

> As Shaba wrote, I also use BSF to create more complex variables.
>
> Shmuel Krakower.
> Beatsoo.org - re-use your jmeter scripts for application performance
> monitoring from worldwide locations for free.
>
>
>
> On Fri, Nov 2, 2012 at 5:22 PM, Philippe Bossu <pb...@gmail.com> wrote:
>
> > Thank you Shaba K.
> > My answers below
> >
> > On Fri, Nov 2, 2012 at 4:16 PM, Shaba K <sh...@gmail.com> wrote:
> >
> > > Debug sampler ..helps in debugging what is stored in various variable's
> > or
> > > functions return value.
> > >
> > > I know that but is it the right place to put a function call
> > ${__logn(...)} for example in the name ?
> > I don't find that very clean but maybe it's the right way
> >
> >
> > > If it is regular expression - use regular expression extractor
> > >
> > > YOu mean if I use regexFunction function, then I should use Regex
> > Extractor,  I agree. But it does not answer my question.
> >
> > Bean shell smapler - if it is java script that performs some operations &
> > > returns value.
> > >
> > > So I can calll functions inside Beanshell ? But doesn't it trigger more
> > work than just putting the function inside DebugSampler name ?
> >
> >
> >
> > > Cheers,
> > > S
> > >
> > > On Fri, Nov 2, 2012 at 3:03 PM, Philippe Bossu <pb...@gmail.com>
> wrote:
> > >
> > > > Hello,
> > > > I was wondering what is the best place to put a function call in a
> > JMeter
> > > > Test Plan.
> > > >
> > > > I have the answer for:
> > > >  functions that will be used as variables in the rest of test plan,
> > best
> > > > place would be User Defined Variables config element
> > > > functions which result is the value of a parameter, I would put them
> in
> > > the
> > > > parameter Value column of the Table
> > > >
> > > > But for others that are not parameters of a sample or that build many
> > > > different variables ?
> > > >
> > > > Let's say I want to:
> > > > split a String
> > > > log / logn
> > > > Is putting them in a Debug Sampler a good idea ? in which field name
> or
> > > > comment ?
> > > >
> > > > Thank you for your help
> > > > Regards
> > > >
> > >
> >
>

Re: Best place to put function calls

Posted by Shmuel Krakower <sh...@gmail.com>.
As Shaba wrote, I also use BSF to create more complex variables.

Shmuel Krakower.
Beatsoo.org - re-use your jmeter scripts for application performance
monitoring from worldwide locations for free.



On Fri, Nov 2, 2012 at 5:22 PM, Philippe Bossu <pb...@gmail.com> wrote:

> Thank you Shaba K.
> My answers below
>
> On Fri, Nov 2, 2012 at 4:16 PM, Shaba K <sh...@gmail.com> wrote:
>
> > Debug sampler ..helps in debugging what is stored in various variable's
> or
> > functions return value.
> >
> > I know that but is it the right place to put a function call
> ${__logn(...)} for example in the name ?
> I don't find that very clean but maybe it's the right way
>
>
> > If it is regular expression - use regular expression extractor
> >
> > YOu mean if I use regexFunction function, then I should use Regex
> Extractor,  I agree. But it does not answer my question.
>
> Bean shell smapler - if it is java script that performs some operations &
> > returns value.
> >
> > So I can calll functions inside Beanshell ? But doesn't it trigger more
> work than just putting the function inside DebugSampler name ?
>
>
>
> > Cheers,
> > S
> >
> > On Fri, Nov 2, 2012 at 3:03 PM, Philippe Bossu <pb...@gmail.com> wrote:
> >
> > > Hello,
> > > I was wondering what is the best place to put a function call in a
> JMeter
> > > Test Plan.
> > >
> > > I have the answer for:
> > >  functions that will be used as variables in the rest of test plan,
> best
> > > place would be User Defined Variables config element
> > > functions which result is the value of a parameter, I would put them in
> > the
> > > parameter Value column of the Table
> > >
> > > But for others that are not parameters of a sample or that build many
> > > different variables ?
> > >
> > > Let's say I want to:
> > > split a String
> > > log / logn
> > > Is putting them in a Debug Sampler a good idea ? in which field name or
> > > comment ?
> > >
> > > Thank you for your help
> > > Regards
> > >
> >
>

Re: Best place to put function calls

Posted by Philippe Bossu <pb...@gmail.com>.
Thank you Shaba K.
My answers below

On Fri, Nov 2, 2012 at 4:16 PM, Shaba K <sh...@gmail.com> wrote:

> Debug sampler ..helps in debugging what is stored in various variable's or
> functions return value.
>
> I know that but is it the right place to put a function call
${__logn(...)} for example in the name ?
I don't find that very clean but maybe it's the right way


> If it is regular expression - use regular expression extractor
>
> YOu mean if I use regexFunction function, then I should use Regex
Extractor,  I agree. But it does not answer my question.

Bean shell smapler - if it is java script that performs some operations &
> returns value.
>
> So I can calll functions inside Beanshell ? But doesn't it trigger more
work than just putting the function inside DebugSampler name ?



> Cheers,
> S
>
> On Fri, Nov 2, 2012 at 3:03 PM, Philippe Bossu <pb...@gmail.com> wrote:
>
> > Hello,
> > I was wondering what is the best place to put a function call in a JMeter
> > Test Plan.
> >
> > I have the answer for:
> >  functions that will be used as variables in the rest of test plan, best
> > place would be User Defined Variables config element
> > functions which result is the value of a parameter, I would put them in
> the
> > parameter Value column of the Table
> >
> > But for others that are not parameters of a sample or that build many
> > different variables ?
> >
> > Let's say I want to:
> > split a String
> > log / logn
> > Is putting them in a Debug Sampler a good idea ? in which field name or
> > comment ?
> >
> > Thank you for your help
> > Regards
> >
>

Re: Best place to put function calls

Posted by Shaba K <sh...@gmail.com>.
Debug sampler ..helps in debugging what is stored in various variable's or
functions return value.

If it is regular expression - use regular expression extractor

Bean shell smapler - if it is java script that performs some operations &
returns value.

Cheers,
S

On Fri, Nov 2, 2012 at 3:03 PM, Philippe Bossu <pb...@gmail.com> wrote:

> Hello,
> I was wondering what is the best place to put a function call in a JMeter
> Test Plan.
>
> I have the answer for:
>  functions that will be used as variables in the rest of test plan, best
> place would be User Defined Variables config element
> functions which result is the value of a parameter, I would put them in the
> parameter Value column of the Table
>
> But for others that are not parameters of a sample or that build many
> different variables ?
>
> Let's say I want to:
> split a String
> log / logn
> Is putting them in a Debug Sampler a good idea ? in which field name or
> comment ?
>
> Thank you for your help
> Regards
>