You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Adrian Speteanu <as...@gmail.com> on 2011/01/18 17:18:46 UTC

While controller / CSV Data Set tricky if condition depends on

Hello everybody,

Need help / suggestions about test idea. Bellow you have the test plan ( the
while controller is setup just like in the CSV example that comes with
jmeter):

thread group [ loop = forever ]
 + While controller
    [ While condition : ${__jexl("${somethingFromCSV}" != "<EOF>")} ]
     ++ CSV Data Set
          [ Configuration of the CSV Data Source: Variables =
somethingFromCSV ; Recycle On EOF = False ; Stop thread on EOF = False ;
Sharing mode = All threads OR Current thread ]
     ++ IF Controller [ "${somethingFromCSV}" != "<EOF>" ]
          +++ 2 x Samplers
  + ... rest of the test ...
        ++ Stop test condition

On the second loop, the loop condition is met (and just to be sure I added a
beanshell before the while in order to set the variable to an other string),
but the CSV does not reset and it is still stuck on EOF => the IF Condition
cannot be met. The problem is that I can't use "Recycle on EOF = True"
because then the While conditions will never be met.

So my question is:  YELP?? :) I just can't figure this one out, I have a
blocker on it.

Thanks.

Re: While controller / CSV Data Set tricky if condition depends on

Posted by Adrian Speteanu <as...@gmail.com>.
On Tue, Jan 18, 2011 at 7:03 PM, sebb <se...@gmail.com> wrote:

> On 18 January 2011 16:18, Adrian Speteanu <as...@gmail.com> wrote:
> > Hello everybody,
> >
> > Need help / suggestions about test idea. Bellow you have the test plan (
> the
> > while controller is setup just like in the CSV example that comes with
> > jmeter):
> >
> > thread group [ loop = forever ]
> >  + While controller
> >    [ While condition : ${__jexl("${somethingFromCSV}" != "<EOF>")} ]
> >     ++ CSV Data Set
> >          [ Configuration of the CSV Data Source: Variables =
> > somethingFromCSV ; Recycle On EOF = False ; Stop thread on EOF = False ;
> > Sharing mode = All threads OR Current thread ]
> >     ++ IF Controller [ "${somethingFromCSV}" != "<EOF>" ]
> >          +++ 2 x Samplers
> >  + ... rest of the test ...
> >        ++ Stop test condition
> >
> > On the second loop, the loop condition is met (and just to be sure I
> added a
> > beanshell before the while in order to set the variable to an other
> string),
> > but the CSV does not reset and it is still stuck on EOF => the IF
> Condition
> > cannot be met. The problem is that I can't use "Recycle on EOF = True"
> > because then the While conditions will never be met.
> >
> > So my question is:  YELP?? :) I just can't figure this one out, I have a
> > blocker on it.
>
> This is nothing to do with the While Controller. AFAIK, the CSV
> Dataset element is not designed to read past EOF.


> If you need to repeat the file contents, then set Recycle on EOF =
> True, and use the final value in the if condition.
>
> If necessary, add another column to the CSV file, and have <EOF> as
> the final value of that column.
>

Of course, this works. Thanks a lot!


This isn't a problem with While Controller, of course, but a limitation with
this scenario - in the sense that you need to use both Recycle on EOF and
the EOF as a condition and since you can't reset the CSV Config on the next
thread repetition (i.e. like the Clear cookies each iteration in the Cookie
manager) then you have to use this workaround.





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

Re: While controller / CSV Data Set tricky if condition depends on

Posted by sebb <se...@gmail.com>.
On 18 January 2011 16:18, Adrian Speteanu <as...@gmail.com> wrote:
> Hello everybody,
>
> Need help / suggestions about test idea. Bellow you have the test plan ( the
> while controller is setup just like in the CSV example that comes with
> jmeter):
>
> thread group [ loop = forever ]
>  + While controller
>    [ While condition : ${__jexl("${somethingFromCSV}" != "<EOF>")} ]
>     ++ CSV Data Set
>          [ Configuration of the CSV Data Source: Variables =
> somethingFromCSV ; Recycle On EOF = False ; Stop thread on EOF = False ;
> Sharing mode = All threads OR Current thread ]
>     ++ IF Controller [ "${somethingFromCSV}" != "<EOF>" ]
>          +++ 2 x Samplers
>  + ... rest of the test ...
>        ++ Stop test condition
>
> On the second loop, the loop condition is met (and just to be sure I added a
> beanshell before the while in order to set the variable to an other string),
> but the CSV does not reset and it is still stuck on EOF => the IF Condition
> cannot be met. The problem is that I can't use "Recycle on EOF = True"
> because then the While conditions will never be met.
>
> So my question is:  YELP?? :) I just can't figure this one out, I have a
> blocker on it.

This is nothing to do with the While Controller. AFAIK, the CSV
Dataset element is not designed to read past EOF.

If you need to repeat the file contents, then set Recycle on EOF =
True, and use the final value in the if condition.

If necessary, add another column to the CSV file, and have <EOF> as
the final value of that column.

> Thanks.
>

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