You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ian Blavins <ib...@temenos.com> on 2008/09/07 13:25:28 UTC

User defined variables

G'day

 

I think some of my early confusion with JMeter would have been avoided
if User Defined Variables were instead called User Defined Constants.
They do after all behave as constants rather than variables. Once their
value has been finally established during test plan initialization there
is no way to change them during test plan execution.  For clarity it
would probably be good if the GUI enforced the convention that UDVs only
be defined immediately under the test plan. Execution of individual test
plan elements in an order different from their physical placement order
is confusing.

 

 

 

Ian Blavins
Software performance specialist

.

TEMENOS
The Banking Software Company

.

PeopleBuilding 2, Maylands Av

Hemel Hempstead   UK   HP2 4NW

.

T:  +44 (0) 1442 431 106
E:  iblavins@temenos.com

.

www.temenos.com <http://www.temenos.com> 

.

P Consider the environment. Please don't print this e-mail unless you
really need to.

 


Disclaimer:
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.


Re: User defined variables

Posted by sebb <se...@gmail.com>.
On 08/09/2008, Ian Blavins <ib...@temenos.com> wrote:
> G'day
>
>  My understanding is that the UDP actually creates a local variable of the same name and doesn't alter the value of the UDV.
>
>  From the manual:
>
>  "If a runtime element such as a User Parameters Pre-Processor or Regular Expression Extractor defines a variable with the same name as one of the global variables, then other test elements will see the local value of the variable. The global value is not affected."

That could be phrased better.
The UDV values are better thought of as initial values.

>  I take this to be true for other elements that write to variables with names matching those created by the UDV. If this is the case then UDV values are constant. UDVs become inaccessible in the scope of any local variable of the same name but their value doesn't change.
>

The scope of a variable is the entire thread - once the value is
updated, all other elements see the new value in that thread.

>
>  Indeed the documentation does suggest that UDVs be restricted to the test plan. But allowing them to be placed in the body of the plan, and calling them UD variables, does suggest a different intended usage.
>

It would be possible to restrict UDVs to the test plan, but that would
be a lot of work - at least compared with improving the documentation.
And what should one do about existing test plans?

I see no reason not to call them variables - the UDV element is used
to define JMeter variables. The fact that it only defines the initial
values does not stop them from being variables.

>
>
>
>  Ian Blavins
>  Software performance specialist
>  .
>  TEMENOS
>  The Banking Software Company
>  .
>  PeopleBuilding 2, Maylands Av
>  Hemel Hempstead   UK   HP2 4NW
>  .
>  T:  +44 (0) 1442 431 106
>  E:  iblavins@temenos.com
>  .
>  www.temenos.com
>
> .
>   Consider the environment. Please don't print this e-mail unless you really need to.
>
>
>  -----Original Message-----
>  From: sebb [mailto:sebbaz@gmail.com]
>  Sent: Sunday, 7 September 2008 5:34 PM
>  To: JMeter Users List
>  Subject: Re: User defined variables
>
>  On 07/09/2008, Ian Blavins <ib...@temenos.com> wrote:
>  > G'day
>  >
>  >
>  >
>  >  I think some of my early confusion with JMeter would have been avoided
>  >  if User Defined Variables were instead called User Defined Constants.
>  >  They do after all behave as constants rather than variables. Once their
>  >  value has been finally established during test plan initialization there
>  >  is no way to change them during test plan execution.
>
>  Actually, they are not constant.
>
>  The values of any variables defined by the UDV element can be
>  overwritten by the User Parameters Pre-Processor, or any other
>  elements that write to variables.
>
>  >  For clarity it
>  >  would probably be good if the GUI enforced the convention that UDVs only
>  >  be defined immediately under the test plan. Execution of individual test
>  >  plan elements in an order different from their physical placement order
>  >  is confusing.
>  >
>
>  The 2.3.2 documentation already suggests restricting them to the start
>  of the thread group.
>
>  >
>  >
>  >
>  >
>  >
>  >  Ian Blavins
>  >  Software performance specialist
>  >
>  >  .
>  >
>  >  TEMENOS
>  >  The Banking Software Company
>  >
>  >  .
>  >
>  >  PeopleBuilding 2, Maylands Av
>  >
>  >  Hemel Hempstead   UK   HP2 4NW
>  >
>  >  .
>  >
>  >  T:  +44 (0) 1442 431 106
>  >  E:  iblavins@temenos.com
>  >
>  >  .
>  >
>  >  www.temenos.com <http://www.temenos.com>
>  >
>  >  .
>  >
>  >  P Consider the environment. Please don't print this e-mail unless you
>  >  really need to.
>  >
>  >
>  >
>  >
>  >  Disclaimer:
>  >  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.
>  >
>  >
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>
>  Disclaimer:
>  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.
>
>

RE: User defined variables

Posted by Ian Blavins <ib...@temenos.com>.
G'day

My understanding is that the UDP actually creates a local variable of the same name and doesn't alter the value of the UDV.

From the manual:

"If a runtime element such as a User Parameters Pre-Processor or Regular Expression Extractor defines a variable with the same name as one of the global variables, then other test elements will see the local value of the variable. The global value is not affected."

I take this to be true for other elements that write to variables with names matching those created by the UDV. If this is the case then UDV values are constant. UDVs become inaccessible in the scope of any local variable of the same name but their value doesn't change.


Indeed the documentation does suggest that UDVs be restricted to the test plan. But allowing them to be placed in the body of the plan, and calling them UD variables, does suggest a different intended usage.




Ian Blavins
Software performance specialist
.
TEMENOS
The Banking Software Company
.
PeopleBuilding 2, Maylands Av
Hemel Hempstead   UK   HP2 4NW
.
T:  +44 (0) 1442 431 106
E:  iblavins@temenos.com
.
www.temenos.com
.
 Consider the environment. Please don't print this e-mail unless you really need to.

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Sunday, 7 September 2008 5:34 PM
To: JMeter Users List
Subject: Re: User defined variables

On 07/09/2008, Ian Blavins <ib...@temenos.com> wrote:
> G'day
>
>
>
>  I think some of my early confusion with JMeter would have been avoided
>  if User Defined Variables were instead called User Defined Constants.
>  They do after all behave as constants rather than variables. Once their
>  value has been finally established during test plan initialization there
>  is no way to change them during test plan execution.

Actually, they are not constant.

The values of any variables defined by the UDV element can be
overwritten by the User Parameters Pre-Processor, or any other
elements that write to variables.

>  For clarity it
>  would probably be good if the GUI enforced the convention that UDVs only
>  be defined immediately under the test plan. Execution of individual test
>  plan elements in an order different from their physical placement order
>  is confusing.
>

The 2.3.2 documentation already suggests restricting them to the start
of the thread group.

>
>
>
>
>
>  Ian Blavins
>  Software performance specialist
>
>  .
>
>  TEMENOS
>  The Banking Software Company
>
>  .
>
>  PeopleBuilding 2, Maylands Av
>
>  Hemel Hempstead   UK   HP2 4NW
>
>  .
>
>  T:  +44 (0) 1442 431 106
>  E:  iblavins@temenos.com
>
>  .
>
>  www.temenos.com <http://www.temenos.com>
>
>  .
>
>  P Consider the environment. Please don't print this e-mail unless you
>  really need to.
>
>
>
>
>  Disclaimer:
>  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.
>
>

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


Disclaimer:
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.


Re: User defined variables

Posted by sebb <se...@gmail.com>.
On 07/09/2008, Ian Blavins <ib...@temenos.com> wrote:
> G'day
>
>
>
>  I think some of my early confusion with JMeter would have been avoided
>  if User Defined Variables were instead called User Defined Constants.
>  They do after all behave as constants rather than variables. Once their
>  value has been finally established during test plan initialization there
>  is no way to change them during test plan execution.

Actually, they are not constant.

The values of any variables defined by the UDV element can be
overwritten by the User Parameters Pre-Processor, or any other
elements that write to variables.

>  For clarity it
>  would probably be good if the GUI enforced the convention that UDVs only
>  be defined immediately under the test plan. Execution of individual test
>  plan elements in an order different from their physical placement order
>  is confusing.
>

The 2.3.2 documentation already suggests restricting them to the start
of the thread group.

>
>
>
>
>
>  Ian Blavins
>  Software performance specialist
>
>  .
>
>  TEMENOS
>  The Banking Software Company
>
>  .
>
>  PeopleBuilding 2, Maylands Av
>
>  Hemel Hempstead   UK   HP2 4NW
>
>  .
>
>  T:  +44 (0) 1442 431 106
>  E:  iblavins@temenos.com
>
>  .
>
>  www.temenos.com <http://www.temenos.com>
>
>  .
>
>  P Consider the environment. Please don't print this e-mail unless you
>  really need to.
>
>
>
>
>  Disclaimer:
>  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.
>
>

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