I'm not sure I understand but I don't think I agree...
Whenever we want to change a variable in a flexible way, can't we just insert a
BeanShell sampler anywhere and execute a bit of code to change a variable?
Example, insert a BeanShell Sampler with this code to read an existing
variable, change it, then store it somewhere else:
"""
String LoginID = vars.getObject ("LoginID");
String UserNumber = LoginID.substring (2);
vars.put ("UserNumber", UserNumber);
"""
This isn't fixed to the start of the test, nor to User Variables, nor to being
a pre or post processor. The only problem I can think of is that a BeanShell
Sampler generates a "sample" result, which is quite stupid when we merely want
to execute some code. What we need is a new control that can just run a script
without «also» generating a "sample".
Or maybe I'm just not understanding properly..?
Regards,
Paulo Augusto Maia Borges
-----Original Message-----
From: Jmeter Tea <[email protected]>
Sent: 15 November 2018 11:37
To: [email protected]
Subject: Re: Place holder for function execution / Variables evaluation
IMHO It's a great and important enhancement (long time coming)
On Thu, Nov 15, 2018 at 11:10 AM Philippe Mouawad < [email protected]>
wrote:
> Hello All,
> Any thoughts on this ?
>
> Thanks
>
> On Mon, Nov 12, 2018 at 1:03 PM Philippe Mouawad <
> [email protected]>
> wrote:
>
> > I intended to add a new Panel (Evaluate Variables) with:
> >
> > - A radio box : Evaluate Variables
> > - And a User Defined Variables Table
> >
> >
> >
> > On Mon, Nov 12, 2018 at 12:56 PM Andrey Pokhilko <[email protected]> wrote:
> >
> >> Can you give a mock of how you envision it implemented in Flow
> >> Control Action?
> >>
> >> --
> >>
> >> Andrey Pokhilko
> >>
> >> 12.11.2018 14:50, Philippe Mouawad пишет:
> >> > Thanks for information.
> >> > I feel this behavior should be in core.
> >> >
> >> > To avoid another element, I think updating Flow Control Action is
> >> > a
> good
> >> > candidate as it’s a sample about jmeter internals.
> >> >
> >> > Thoughts?
> >> >
> >> > Regards
> >> >
> >> > On Monday, November 12, 2018, Andrey Pokhilko <[email protected]> wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> There's already a plugin for that:
> >> >> https://jmeter-plugins.org/wiki/SetVariablesAction/
> >> >>
> >> >> It is exactly a sampler that is used to evaluate functions/variables.
> >> >>
> >> >> --
> >> >>
> >> >> Andrey Pokhilko
> >> >>
> >> >> 11.11.2018 20:53, Philippe Mouawad пишет:
> >> >>> Hello,
> >> >>> Frequently when using JMeter functions, users don't really know
> >> >>> for
> >> >> certain
> >> >>> use cases where to put the function, here are few examples:
> >> >>>
> >> >>> - Any function which output will not be used directly by sample
> >> >>> parameters
> >> >>> - Such type of functions:
> >> >>> - https://jmeter-plugins.org/wiki/InterThreadCommunication/
> >> >>> - you want to create a variable from the output of a
> >> >>> function and
> >> >> update
> >> >>> it on each iteration:
> >> >>> - User Defined Variable is not an option as evaluation
> >> >>> occurs
> on
> >> >>> start of test
> >> >>> - User Parameters being a preprocessor, it would be
> >> >>> evaluated
> on
> >> >> each
> >> >>> call, so you need to nest it inside a Flow Control
> >> >>> Action, not
> >> very
> >> >>> intuitive right ?
> >> >>>
> >> >>> I also remember when I started using JMeter that I found this
> >> >>> part counter-intuitive.
> >> >>>
> >> >>> I think it would be nice to have a solution for this, that
> >> >>> would
> >> evaluate
> >> >>> the variables/functions exactly at the place where the call is
> present
> >> >> and
> >> >>> without generating any SampleResult.
> >> >>>
> >> >>> We could implement this:
> >> >>>
> >> >>> - as an enhancement to Flow Control Action
> >> >>> - as a new Sampler
> >> >>>
> >> >>> What's your thoughts on this ?
> >> >>>
> >> >>> Regards
> >> >>>
> >> >
> >>
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
> >
> >
>
> --
> Cordialement.
> Philippe Mouawad.
>
The information in this e-mail and any attachments is confidential and may be
legally privileged. It is intended solely for the addressee or addressees. Any
use or disclosure of the contents of this e-mail/attachments by a not intended
recipient is unauthorized and may be unlawful. If you have received this e-mail
in error please notify the sender. Please note that any views or opinions
presented in this e-mail are solely those of the author and do not necessarily
represent those of TEMENOS. We recommend that you check this e-mail and any
attachments against viruses. TEMENOS accepts no liability for any damage caused
by any malicious code or virus transmitted by this e-mail.