You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Peter Bernier <jm...@binarytwo.com> on 2005/08/17 21:37:05 UTC

Unexpected Behaviour with TestPlan-Level User Defined Variables

Hello,

I'm just trying to figure out whether or not this is a bug.

When you have a User-Defined Variables Config Element at the Test-Plan
level (as opposed to on the Test Plan node itself), variables are
re-calculated with every request (as opposed to at the Thread Group or
below level where they're calculated once).

This is different from the behaviour of this Config Element anywhere else
in a Test Plan. I'm just wondering whether this is expected behaviour,
or not?

Specifically what's got me is that in the Component Reference (Sec
15.4.14) It says "The User Defined Variables lets you define variables
for use in other test elements, just as in the Test Plan.", but this
isn't quite accurate since you can use functions (ie, __Random) on the
UDV Config Element whereas you can't on the Test Plan's UDV.

The reason I bring this up is that I've recently switched to storing
TestPlan-wide variables in a UDV Config Element at the Test-Plan level
as opposed to on the Test Plan node itself. (due to Bug 35872)

- Peter Bernier

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


Re: Unexpected Behaviour with TestPlan-Level User Defined Variables

Posted by Michael Stover <ms...@apache.org>.
I'm not sure I understand. Can you send the actual .jmx test file?

-Mike

On Thu, 2005-08-18 at 07:34 +0200, Miklos Tverdota wrote:
> Hi,
> 
> 
> I have the same effect with 
> ${__split(${_StringFromFile(Myfile,Myvar,,)},usrP,|)} even if the user 
> variable defined below the Threadgroup.
> It seems that each reference to the variable usrP_1, usrP_2 updates the 
> file pointer.
> It is not possible to use Myvar and usrP_x  in the same time.  A 
> reference to Myvar cause an error.
> 
> Name: Myvar, Value: new
> Name:dummy, Value:${__split(${_StringFromFile(Myfile,Myvar,,)},usrP,|)}
> 
> Regards,
> 
> Miklos
> 
> Michael Stover wrote:
> 
> >Funny you should mention that as I've just reworked the TestPlan element
> >so that functions can be used in it's user-defined variables section
> >(they will be evaluated once - useful for, say ,the __P function).  I'm
> >wondering whether I dare risk committing it for the 2.1 release.
> >
> >The bug you mention regarding the config element is very interesting.
> >Sounds like a neat feature actually :-)  I'll take a look..
> >
> >
> >-Mike
> >
> >On Wed, 2005-08-17 at 19:37 +0000, Peter Bernier wrote:
> >  
> >
> >>Hello,
> >>
> >>I'm just trying to figure out whether or not this is a bug.
> >>
> >>When you have a User-Defined Variables Config Element at the Test-Plan
> >>level (as opposed to on the Test Plan node itself), variables are
> >>re-calculated with every request (as opposed to at the Thread Group or
> >>below level where they're calculated once).
> >>
> >>This is different from the behaviour of this Config Element anywhere else
> >>in a Test Plan. I'm just wondering whether this is expected behaviour,
> >>or not?
> >>
> >>Specifically what's got me is that in the Component Reference (Sec
> >>15.4.14) It says "The User Defined Variables lets you define variables
> >>for use in other test elements, just as in the Test Plan.", but this
> >>isn't quite accurate since you can use functions (ie, __Random) on the
> >>UDV Config Element whereas you can't on the Test Plan's UDV.
> >>
> >>The reason I bring this up is that I've recently switched to storing
> >>TestPlan-wide variables in a UDV Config Element at the Test-Plan level
> >>as opposed to on the Test Plan node itself. (due to Bug 35872)
> >>
> >>- Peter Bernier
> >>
> >>---------------------------------------------------------------------
> >>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
> >
> >
> >
> >  
> >
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Unexpected Behaviour with TestPlan-Level User Defined Variables

Posted by Miklos Tverdota <tv...@axelero.hu>.
Hi,


I have the same effect with 
${__split(${_StringFromFile(Myfile,Myvar,,)},usrP,|)} even if the user 
variable defined below the Threadgroup.
It seems that each reference to the variable usrP_1, usrP_2 updates the 
file pointer.
It is not possible to use Myvar and usrP_x  in the same time.  A 
reference to Myvar cause an error.

Name: Myvar, Value: new
Name:dummy, Value:${__split(${_StringFromFile(Myfile,Myvar,,)},usrP,|)}

Regards,

Miklos

Michael Stover wrote:

>Funny you should mention that as I've just reworked the TestPlan element
>so that functions can be used in it's user-defined variables section
>(they will be evaluated once - useful for, say ,the __P function).  I'm
>wondering whether I dare risk committing it for the 2.1 release.
>
>The bug you mention regarding the config element is very interesting.
>Sounds like a neat feature actually :-)  I'll take a look..
>
>
>-Mike
>
>On Wed, 2005-08-17 at 19:37 +0000, Peter Bernier wrote:
>  
>
>>Hello,
>>
>>I'm just trying to figure out whether or not this is a bug.
>>
>>When you have a User-Defined Variables Config Element at the Test-Plan
>>level (as opposed to on the Test Plan node itself), variables are
>>re-calculated with every request (as opposed to at the Thread Group or
>>below level where they're calculated once).
>>
>>This is different from the behaviour of this Config Element anywhere else
>>in a Test Plan. I'm just wondering whether this is expected behaviour,
>>or not?
>>
>>Specifically what's got me is that in the Component Reference (Sec
>>15.4.14) It says "The User Defined Variables lets you define variables
>>for use in other test elements, just as in the Test Plan.", but this
>>isn't quite accurate since you can use functions (ie, __Random) on the
>>UDV Config Element whereas you can't on the Test Plan's UDV.
>>
>>The reason I bring this up is that I've recently switched to storing
>>TestPlan-wide variables in a UDV Config Element at the Test-Plan level
>>as opposed to on the Test Plan node itself. (due to Bug 35872)
>>
>>- Peter Bernier
>>
>>---------------------------------------------------------------------
>>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
>
>
>
>  
>



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


Re: Unexpected Behaviour with TestPlan-Level User Defined Variables

Posted by Michael Stover <ms...@apache.org>.
It is not something that can be turned on or off as it involved several
changes in multiple files.  The change that worries me was in
FunctionProperty:

Line #73:

if (!isRunningVersion() /*|| !ctx.isSamplingStarted()*/) {

I commented out part of the line.  I'm pretty confident the check for
isSamplingStarted has been made obsolete by other changes in
StandardJMeterEngine since, but can't be sure.  It seems to work very
well here for me, and I'd really like this to make the release.  The
question is, do people feel up to some testing of it?

-Mike

On Wed, 2005-08-17 at 23:10 +0100, sebb wrote:
> Depends whether the change affects only functions in that particular
> instance, or elsewhere as well.
> 
> Unfortunately at present the JUnit tests don't include any testing of
> functions in "real" test plans, only as part of artificial snippets.
> 
> Can it be easily enabled or disabled via property? 
> If so, I suggest including it, but default to off. Then the
> adventurous can explore...
> 
> S.
> On 17/08/05, Peter Lin <wo...@gmail.com> wrote:
> > seems like it might be good to have it, though I rarely use the
> > functions and user defined variables
> > 
> > 
> > peter
> > 
> > 
> > On 8/17/05, Michael Stover <ms...@apache.org> wrote:
> > > The User-Defined Config Element doesn't work as you describe in my
> > > instance.  In my instance, functions didn't work in it either, just like
> > > the Test Plan (before I fixed the Test Plan).  Now, I've fixed it just
> > > like the Test Plan and now both behave the same - ie functions are
> > > resolved once at test start.
> > >
> > > Question is, should I check this code in before the 2.1 release?  I
> > > judge it somewhat risky code.
> > >
> > > -Mike
> > >
> > > On Wed, 2005-08-17 at 16:04 -0400, Michael Stover wrote:
> > > > Funny you should mention that as I've just reworked the TestPlan element
> > > > so that functions can be used in it's user-defined variables section
> > > > (they will be evaluated once - useful for, say ,the __P function).  I'm
> > > > wondering whether I dare risk committing it for the 2.1 release.
> > > >
> > > > The bug you mention regarding the config element is very interesting.
> > > > Sounds like a neat feature actually :-)  I'll take a look..
> > > >
> > > >
> > > > -Mike
> > > >
> > > > On Wed, 2005-08-17 at 19:37 +0000, Peter Bernier wrote:
> > > > > Hello,
> > > > >
> > > > > I'm just trying to figure out whether or not this is a bug.
> > > > >
> > > > > When you have a User-Defined Variables Config Element at the Test-Plan
> > > > > level (as opposed to on the Test Plan node itself), variables are
> > > > > re-calculated with every request (as opposed to at the Thread Group or
> > > > > below level where they're calculated once).
> > > > >
> > > > > This is different from the behaviour of this Config Element anywhere else
> > > > > in a Test Plan. I'm just wondering whether this is expected behaviour,
> > > > > or not?
> > > > >
> > > > > Specifically what's got me is that in the Component Reference (Sec
> > > > > 15.4.14) It says "The User Defined Variables lets you define variables
> > > > > for use in other test elements, just as in the Test Plan.", but this
> > > > > isn't quite accurate since you can use functions (ie, __Random) on the
> > > > > UDV Config Element whereas you can't on the Test Plan's UDV.
> > > > >
> > > > > The reason I bring this up is that I've recently switched to storing
> > > > > TestPlan-wide variables in a UDV Config Element at the Test-Plan level
> > > > > as opposed to on the Test Plan node itself. (due to Bug 35872)
> > > > >
> > > > > - Peter Bernier
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > 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
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> > >
> > >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 


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


Re: Unexpected Behaviour with TestPlan-Level User Defined Variables

Posted by sebb <se...@gmail.com>.
Depends whether the change affects only functions in that particular
instance, or elsewhere as well.

Unfortunately at present the JUnit tests don't include any testing of
functions in "real" test plans, only as part of artificial snippets.

Can it be easily enabled or disabled via property? 
If so, I suggest including it, but default to off. Then the
adventurous can explore...

S.
On 17/08/05, Peter Lin <wo...@gmail.com> wrote:
> seems like it might be good to have it, though I rarely use the
> functions and user defined variables
> 
> 
> peter
> 
> 
> On 8/17/05, Michael Stover <ms...@apache.org> wrote:
> > The User-Defined Config Element doesn't work as you describe in my
> > instance.  In my instance, functions didn't work in it either, just like
> > the Test Plan (before I fixed the Test Plan).  Now, I've fixed it just
> > like the Test Plan and now both behave the same - ie functions are
> > resolved once at test start.
> >
> > Question is, should I check this code in before the 2.1 release?  I
> > judge it somewhat risky code.
> >
> > -Mike
> >
> > On Wed, 2005-08-17 at 16:04 -0400, Michael Stover wrote:
> > > Funny you should mention that as I've just reworked the TestPlan element
> > > so that functions can be used in it's user-defined variables section
> > > (they will be evaluated once - useful for, say ,the __P function).  I'm
> > > wondering whether I dare risk committing it for the 2.1 release.
> > >
> > > The bug you mention regarding the config element is very interesting.
> > > Sounds like a neat feature actually :-)  I'll take a look..
> > >
> > >
> > > -Mike
> > >
> > > On Wed, 2005-08-17 at 19:37 +0000, Peter Bernier wrote:
> > > > Hello,
> > > >
> > > > I'm just trying to figure out whether or not this is a bug.
> > > >
> > > > When you have a User-Defined Variables Config Element at the Test-Plan
> > > > level (as opposed to on the Test Plan node itself), variables are
> > > > re-calculated with every request (as opposed to at the Thread Group or
> > > > below level where they're calculated once).
> > > >
> > > > This is different from the behaviour of this Config Element anywhere else
> > > > in a Test Plan. I'm just wondering whether this is expected behaviour,
> > > > or not?
> > > >
> > > > Specifically what's got me is that in the Component Reference (Sec
> > > > 15.4.14) It says "The User Defined Variables lets you define variables
> > > > for use in other test elements, just as in the Test Plan.", but this
> > > > isn't quite accurate since you can use functions (ie, __Random) on the
> > > > UDV Config Element whereas you can't on the Test Plan's UDV.
> > > >
> > > > The reason I bring this up is that I've recently switched to storing
> > > > TestPlan-wide variables in a UDV Config Element at the Test-Plan level
> > > > as opposed to on the Test Plan node itself. (due to Bug 35872)
> > > >
> > > > - Peter Bernier
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
>

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


Re: Unexpected Behaviour with TestPlan-Level User Defined Variables

Posted by Peter Lin <wo...@gmail.com>.
seems like it might be good to have it, though I rarely use the
functions and user defined variables


peter


On 8/17/05, Michael Stover <ms...@apache.org> wrote:
> The User-Defined Config Element doesn't work as you describe in my
> instance.  In my instance, functions didn't work in it either, just like
> the Test Plan (before I fixed the Test Plan).  Now, I've fixed it just
> like the Test Plan and now both behave the same - ie functions are
> resolved once at test start.
> 
> Question is, should I check this code in before the 2.1 release?  I
> judge it somewhat risky code.
> 
> -Mike
> 
> On Wed, 2005-08-17 at 16:04 -0400, Michael Stover wrote:
> > Funny you should mention that as I've just reworked the TestPlan element
> > so that functions can be used in it's user-defined variables section
> > (they will be evaluated once - useful for, say ,the __P function).  I'm
> > wondering whether I dare risk committing it for the 2.1 release.
> >
> > The bug you mention regarding the config element is very interesting.
> > Sounds like a neat feature actually :-)  I'll take a look..
> >
> >
> > -Mike
> >
> > On Wed, 2005-08-17 at 19:37 +0000, Peter Bernier wrote:
> > > Hello,
> > >
> > > I'm just trying to figure out whether or not this is a bug.
> > >
> > > When you have a User-Defined Variables Config Element at the Test-Plan
> > > level (as opposed to on the Test Plan node itself), variables are
> > > re-calculated with every request (as opposed to at the Thread Group or
> > > below level where they're calculated once).
> > >
> > > This is different from the behaviour of this Config Element anywhere else
> > > in a Test Plan. I'm just wondering whether this is expected behaviour,
> > > or not?
> > >
> > > Specifically what's got me is that in the Component Reference (Sec
> > > 15.4.14) It says "The User Defined Variables lets you define variables
> > > for use in other test elements, just as in the Test Plan.", but this
> > > isn't quite accurate since you can use functions (ie, __Random) on the
> > > UDV Config Element whereas you can't on the Test Plan's UDV.
> > >
> > > The reason I bring this up is that I've recently switched to storing
> > > TestPlan-wide variables in a UDV Config Element at the Test-Plan level
> > > as opposed to on the Test Plan node itself. (due to Bug 35872)
> > >
> > > - Peter Bernier
> > >
> > > ---------------------------------------------------------------------
> > > 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
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
>

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


Re: Unexpected Behaviour with TestPlan-Level User Defined Variables

Posted by Michael Stover <ms...@apache.org>.
The User-Defined Config Element doesn't work as you describe in my
instance.  In my instance, functions didn't work in it either, just like
the Test Plan (before I fixed the Test Plan).  Now, I've fixed it just
like the Test Plan and now both behave the same - ie functions are
resolved once at test start.

Question is, should I check this code in before the 2.1 release?  I
judge it somewhat risky code.

-Mike

On Wed, 2005-08-17 at 16:04 -0400, Michael Stover wrote:
> Funny you should mention that as I've just reworked the TestPlan element
> so that functions can be used in it's user-defined variables section
> (they will be evaluated once - useful for, say ,the __P function).  I'm
> wondering whether I dare risk committing it for the 2.1 release.
> 
> The bug you mention regarding the config element is very interesting.
> Sounds like a neat feature actually :-)  I'll take a look..
> 
> 
> -Mike
> 
> On Wed, 2005-08-17 at 19:37 +0000, Peter Bernier wrote:
> > Hello,
> > 
> > I'm just trying to figure out whether or not this is a bug.
> > 
> > When you have a User-Defined Variables Config Element at the Test-Plan
> > level (as opposed to on the Test Plan node itself), variables are
> > re-calculated with every request (as opposed to at the Thread Group or
> > below level where they're calculated once).
> > 
> > This is different from the behaviour of this Config Element anywhere else
> > in a Test Plan. I'm just wondering whether this is expected behaviour,
> > or not?
> > 
> > Specifically what's got me is that in the Component Reference (Sec
> > 15.4.14) It says "The User Defined Variables lets you define variables
> > for use in other test elements, just as in the Test Plan.", but this
> > isn't quite accurate since you can use functions (ie, __Random) on the
> > UDV Config Element whereas you can't on the Test Plan's UDV.
> > 
> > The reason I bring this up is that I've recently switched to storing
> > TestPlan-wide variables in a UDV Config Element at the Test-Plan level
> > as opposed to on the Test Plan node itself. (due to Bug 35872)
> > 
> > - Peter Bernier
> > 
> > ---------------------------------------------------------------------
> > 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



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


Re: Unexpected Behaviour with TestPlan-Level User Defined Variables

Posted by Michael Stover <ms...@apache.org>.
Funny you should mention that as I've just reworked the TestPlan element
so that functions can be used in it's user-defined variables section
(they will be evaluated once - useful for, say ,the __P function).  I'm
wondering whether I dare risk committing it for the 2.1 release.

The bug you mention regarding the config element is very interesting.
Sounds like a neat feature actually :-)  I'll take a look..


-Mike

On Wed, 2005-08-17 at 19:37 +0000, Peter Bernier wrote:
> Hello,
> 
> I'm just trying to figure out whether or not this is a bug.
> 
> When you have a User-Defined Variables Config Element at the Test-Plan
> level (as opposed to on the Test Plan node itself), variables are
> re-calculated with every request (as opposed to at the Thread Group or
> below level where they're calculated once).
> 
> This is different from the behaviour of this Config Element anywhere else
> in a Test Plan. I'm just wondering whether this is expected behaviour,
> or not?
> 
> Specifically what's got me is that in the Component Reference (Sec
> 15.4.14) It says "The User Defined Variables lets you define variables
> for use in other test elements, just as in the Test Plan.", but this
> isn't quite accurate since you can use functions (ie, __Random) on the
> UDV Config Element whereas you can't on the Test Plan's UDV.
> 
> The reason I bring this up is that I've recently switched to storing
> TestPlan-wide variables in a UDV Config Element at the Test-Plan level
> as opposed to on the Test Plan node itself. (due to Bug 35872)
> 
> - Peter Bernier
> 
> ---------------------------------------------------------------------
> 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