You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Andrey Pohilko <ap...@fininfor.ru> on 2010/01/13 12:00:10 UTC

Setting jmeter variables in runtime

Hi,
I have a question - how can I use function in test plan to set variable "in
runtime"? Which component type I should use to do that?
Especially I'd like to define variable in one place and later redefine this
variable value in another.
I've experimented with pre-processors, but it's unapplicable, because of
scope requirement. I need something like "Runtime User Defined Variables" in
my plan, which processed like Controller items - in their order.

I even tried to write my own Controller plugin, which will do this, but
stuck with variables and function evaluation approach in code. (Maybe sebb
can help me with this ;)
 
Best regards,
Andrey Pohilko


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


RE: Setting jmeter variables in runtime

Posted by Andrey Pohilko <ap...@fininfor.ru>.
Hi, Thibaut!

Sampler potentially does what I need, but I don't want fake samples to be
recorded in my results.
Also I'd like to conveniently manage a list of variables similar to UDV's
list.
Also I'm not familiar with beanshell and don't know how to set variables
there.
Also I'm afraid of beanshell performance - is it economic at hundreds of
threads with many beanshell samplers in each of them?
 
С уважением,
Андрей Похилько

-----Original Message-----
From: Thibaut Raballand [mailto:thibaut.raballand@gmail.com] 
Sent: Wednesday, January 13, 2010 3:10 PM
To: JMeter Users List
Subject: Re: Setting jmeter variables in runtime

Hi,

You can easily create or modify a variable with a beanshell sample placed
anywhere in the script. Variable creation or modification will be done when
the sample will be executed, as for beanshell preprocessors or
postprocessors.

Beanshell Code:
vars.get("VARIABLE_NAME");
vars.put("VARIABLE_NAME","whatYouWant");

You can also use BSF samples or many other samples...

What exactly is your need ? I hope I'm not getting your need wrong.

Regards,
Tibo

On Wed, Jan 13, 2010 at 12:00, Andrey Pohilko <ap...@fininfor.ru> wrote:

> Hi,
> I have a question - how can I use function in test plan to set variable
"in
> runtime"? Which component type I should use to do that?
> Especially I'd like to define variable in one place and later redefine
this
> variable value in another.
> I've experimented with pre-processors, but it's unapplicable, because of
> scope requirement. I need something like "Runtime User Defined Variables"
> in
> my plan, which processed like Controller items - in their order.
>
> I even tried to write my own Controller plugin, which will do this, but
> stuck with variables and function evaluation approach in code. (Maybe sebb
> can help me with this ;)
>
> Best regards,
> Andrey Pohilko
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


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


Re: Setting jmeter variables in runtime

Posted by Thibaut Raballand <th...@gmail.com>.
Hi,

You can easily create or modify a variable with a beanshell sample placed
anywhere in the script. Variable creation or modification will be done when
the sample will be executed, as for beanshell preprocessors or
postprocessors.

Beanshell Code:
vars.get("VARIABLE_NAME");
vars.put("VARIABLE_NAME","whatYouWant");

You can also use BSF samples or many other samples...

What exactly is your need ? I hope I'm not getting your need wrong.

Regards,
Tibo

On Wed, Jan 13, 2010 at 12:00, Andrey Pohilko <ap...@fininfor.ru> wrote:

> Hi,
> I have a question - how can I use function in test plan to set variable "in
> runtime"? Which component type I should use to do that?
> Especially I'd like to define variable in one place and later redefine this
> variable value in another.
> I've experimented with pre-processors, but it's unapplicable, because of
> scope requirement. I need something like "Runtime User Defined Variables"
> in
> my plan, which processed like Controller items - in their order.
>
> I even tried to write my own Controller plugin, which will do this, but
> stuck with variables and function evaluation approach in code. (Maybe sebb
> can help me with this ;)
>
> Best regards,
> Andrey Pohilko
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>