You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ben Damm <bd...@dammfine.com> on 2006/03/22 23:40:08 UTC

Undefining variable values and ForEach

Hello,

  I have a script that reads a line of text once per loop and consumes it 
using CSV Data Set Config, then uses "__split" to split one of those fields.  
There is a ForEach controller that is executing once per value over the inner 
field.

The number of variables changes correctly (X_n is updated) and the ForEach 
controller responds correctly when the number of variables increases.  When 
the number of variables decreases, the ForEach controller appears to ignore 
the newly reduced value of X_n and continues to use the stale contents of the 
variables X_1, X_2, X_3, etc, when it should be stopping at X_1.

Any idea how to unset variables or fix the behaviour of ForEach?

Thank you,
-Ben

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


Re: Undefining variable values and ForEach

Posted by sebb <se...@gmail.com>.
I've updated the split() function to clear the next unused variable.

This will be in the next nightly build (and the upcoming 2.1.2)

S.
On 23/03/06, sebb <se...@gmail.com> wrote:
> On 22/03/06, Ben Damm <bd...@dammfine.com> wrote:
> > Hello,
> >
> >  I have a script that reads a line of text once per loop and consumes it
> > using CSV Data Set Config, then uses "__split" to split one of those fields.
> > There is a ForEach controller that is executing once per value over the inner
> > field.
> >
> > The number of variables changes correctly (X_n is updated) and the ForEach
> > controller responds correctly when the number of variables increases.  When
> > the number of variables decreases, the ForEach controller appears to ignore
> > the newly reduced value of X_n and continues to use the stale contents of the
> > variables X_1, X_2, X_3, etc, when it should be stopping at X_1.
>
> ForEach does not use the count X_n; it stops at the first missing variable.
>
> > Any idea how to unset variables or fix the behaviour of ForEach?
>
> We should probably fix the behaviour of __split() so that it ensures
> that at least the first stale variable is deleted...
>
> In the meantime, the only way to do this is to use BeanShell - this
> was dicussed recently. Search the archives for details.
>
> > Thank you,
> > -Ben
> >
> > ---------------------------------------------------------------------
> > 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: Undefining variable values and ForEach

Posted by sebb <se...@gmail.com>.
On 22/03/06, Ben Damm <bd...@dammfine.com> wrote:
> Hello,
>
>  I have a script that reads a line of text once per loop and consumes it
> using CSV Data Set Config, then uses "__split" to split one of those fields.
> There is a ForEach controller that is executing once per value over the inner
> field.
>
> The number of variables changes correctly (X_n is updated) and the ForEach
> controller responds correctly when the number of variables increases.  When
> the number of variables decreases, the ForEach controller appears to ignore
> the newly reduced value of X_n and continues to use the stale contents of the
> variables X_1, X_2, X_3, etc, when it should be stopping at X_1.

ForEach does not use the count X_n; it stops at the first missing variable.

> Any idea how to unset variables or fix the behaviour of ForEach?

We should probably fix the behaviour of __split() so that it ensures
that at least the first stale variable is deleted...

In the meantime, the only way to do this is to use BeanShell - this
was dicussed recently. Search the archives for details.

> Thank you,
> -Ben
>
> ---------------------------------------------------------------------
> 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