On Tue, Oct 31, 2017 at 5:27 PM, Epp, J Wyatt <[email protected]> wrote:
> > -----Original Message-----
> > From: Philippe Mouawad [mailto:[email protected]]
> > Sent: Friday, 27 October, 2017 03:08
> > To: [email protected]
> > Subject: Re: Having a globalVariables shared accross threads
> >
> > Created :
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=61674
>
> This is a good effort. I think in the interest of usability it would be
> preferable if the global: prefix wasn't needed, but maybe that can be
> addressed
> later.
>
> As far as the implementation, I see this as complementary to the existing
> UserDefinedVariables in the TestPlan, so wouldn't it be better to reuse the
> existing valueReplacer infrastructure as much as possible for this
> effort? (I
> was going to suggest encoding the variable scope as part of the type, but
> it
> looks like they're just simple key-value pairs (Map<String, String>). Oh
> well.)
>
Can you illustrate this ? it's not clear for me.
>
> Alternatively, it might be better to simply improve properties by exposing
> UI
>
You mean a sort of User Defined Properties ?
> and API for properly working with them.
> Looking at the class definition for
> JMeterVariables (from your proposal), the comment at the top of the module
> even
> says:
>
> /**
> * Class which defines JMeter variables.
> * These are similar to properties, but they are local to a single thread.
> */
>
> So unless there's some nuance I've missed, what you need already mostly
> exists,
> but it has a bad workflow and some of the details need work.
>
Yes, I don't know why, when I started increasing coverage, I used
Beanshell to do that :-).
So I started this discussion and then I remembered it was possible and
fixed the coverage but didn't update discussion.
>
> ... Actually, thinking of some things I've tried to do myself, I think the
> ability to define and set properties dynamically, then use them with a
> similar
> sort of shorthand as regular thread-local varibles would be even more
> potent
> than simple global variables. Please consider it.
>
Currently they are used like this ${__P(propName)} .
It is true that the difference between vars and props is not evident for
everybody when starting JMeter. So there is room for improvement.
Having a global prefix is kind of meaningful as it clearly states that they
are shared, so I like the idea.
This could be manipulated this way:
${global:propName}
vars.put("global:propName", "value"); or vars.putGlobal("propName",
"value"); or both ?
Also what would be the difference with properties ?
I initially had in mind to make Global vars related to test life cycle.
Properties are not like this and some properties are read on class loading
and their modification is useless afterwards.
> Cheers,
> Wyatt
>
> Confidentiality Notice: This electronic message transmission, including
> any attachment(s), may contain confidential, proprietary, or privileged
> information from Chemical Abstracts Service ("CAS"), a division of the
> American Chemical Society ("ACS"). If you have received this transmission
> in error, be advised that any disclosure, copying, distribution, or use of
> the contents of this information is strictly prohibited. Please destroy all
> copies of the message and contact the sender immediately by either replying
> to this message or calling 614-447-3600.
>
>
--
Cordialement.
Philippe Mouawad.