You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Erez Naim <er...@theneura.com> on 2015/03/01 15:06:09 UTC

Loop Controller

Hello all,

 

How can I make it in Jmeter that if I am using a loop that take values from
external text file it will take the next value in the text file for each
iteration of the Loop controller? For 10 users 

 

For example: I got 10 users that for each of them I got 10 values which I
take from external file but I noticed that it will take always the first
value inside the Loop controller and it won't proceed to the next one, any
idea how can I solve this problem?

 

Thanks! 

 


Erez Naim  |  QA Lead  |
<http://www.linkedin.com/profile/view?id=34323263>
<http://www.theneura.com/vCards/gilad.vcf>
<http://twitter.com/#!/giladmeiri/>   




EL AL 2 Street | Herzliya  
mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura

 


 <http://www.theneura.com/> website  |   <http://www.startupbitz.com/> blog
|   <https://twitter.com/intent/user?screen_name=theneura> twitter  |
<http://goo.gl/maps/ZRkg5> map    

 

 


Re: Loop Controller

Posted by Flavio Cysne <fl...@gmail.com>.
I agree that CSVRead function should be avoided, but, inside a Loop
Controller, CSV Dataset Config has no utility since it will not get new
data/line after each loop iteraction. Although, it'll work if you use the
Thread Group loop count instead of a Loop Controller.

Re: Loop Controller

Posted by UBIK LOAD PACK Support <su...@ubikloadpack.com>.
Hi,
Sander's solution is a better option and I think it answers the problem.
CSVRead function has a performance impact and should be avoided when
possible.

Regards
@ubikloadpack



On Mon, Mar 2, 2015 at 3:10 PM, Flavio Cysne <fl...@gmail.com> wrote:

> I think I misundertood your question in my first post. Inside a loop
> Controller you'll have to use CSVRead function using another call of this
> function with 'next' value to read the next line of the file.
>
> Hope it is the case.
>



-- 

Regards
Ubik Load Pack <http://ubikloadpack.com> Team
Follow us on Twitter <http://twitter.com/ubikloadpack>


Cordialement
L'équipe Ubik Load Pack <http://ubikloadpack.com>
Suivez-nous sur Twitter <http://twitter.com/ubikloadpack>

RE: Loop Controller

Posted by Erez Naim <er...@theneura.com>.
Hi Flavio, 

The case is that I try to write the user's token to the external text file and write all his data, what I get right now is that for each iteration I write the user's token alongside with his data so if the user got like 10 different data I find in my text file that I write for each one his token again and again and write his data as well... so this is the case...

Thanks! 

-----Original Message-----
From: Flavio Cysne [mailto:flaviocysne@gmail.com] 
Sent: Monday, March 02, 2015 4:11 PM
To: JMeter Users List
Subject: Re: Loop Controller

I think I misundertood your question in my first post. Inside a loop Controller you'll have to use CSVRead function using another call of this function with 'next' value to read the next line of the file.

Hope it is the case.


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


Re: Loop Controller

Posted by Flavio Cysne <fl...@gmail.com>.
I think I misundertood your question in my first post. Inside a loop
Controller you'll have to use CSVRead function using another call of this
function with 'next' value to read the next line of the file.

Hope it is the case.

Re: Loop Controller

Posted by Shmuel Krakower <sh...@gmail.com>.
Make sure the sharing mode in the CSV Dataset Config is set to "All
Threads".
It should get you the required behavior.

Shmuel Krakower.
www.Beatsoo.org - re-use your jmeter scripts for application performance
monitoring from worldwide locations for free.

On Mon, Mar 2, 2015 at 4:04 PM, Flavio Cysne <fl...@gmail.com> wrote:

> If you are using only one JMeter, using a CSV Dataset Config will do what
> you want.
>
> If you are using a distributed environment (presuming 10 JMeter slaves and
> each onde in a different machine) each file has to have only one line from
> the original CSV file.
>
> This shell script should help you to distribute your CSV:
>
> sed -n '1p' original.csv | ssh host:port 'cat > original.csv'
>
> '1p' in sede is used to print the first line of original.csv file. Use '2p'
> to print the second and so on.
>
> Hope it helps
> Em 01/03/2015 11:07, "Erez Naim" <er...@theneura.com> escreveu:
>
> > Hello all,
> >
> >
> >
> > How can I make it in Jmeter that if I am using a loop that take values
> > from external text file it will take the next value in the text file for
> > each iteration of the Loop controller? For 10 users
> >
> >
> >
> > For example: I got 10 users that for each of them I got 10 values which I
> > take from external file but I noticed that it will take always the first
> > value inside the Loop controller and it won't proceed to the next one,
> any
> > idea how can I solve this problem?
> >
> >
> >
> > Thanks!
> >
> >
> >
> > Erez Naim  |  QA Lead  |   [image: LinkedIn]
> > <http://www.linkedin.com/profile/view?id=34323263>  [image: vCard]
> > <http://www.theneura.com/vCards/gilad.vcf>  [image: Twitter]
> > <http://twitter.com/#!/giladmeiri/>
> >
> > [image: cid:image004.png@01D01E1B.5F153500]
> >
> > EL AL 2 Street | Herzliya
> > mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura
> >
> >
> >
> > website <http://www.theneura.com/>  |  blog <http://www.startupbitz.com/
> >
> >  |  twitter <https://twitter.com/intent/user?screen_name=theneura>  |
> map
> > <http://goo.gl/maps/ZRkg5>
> >
> >
> >
> >
> >
>

Re: Loop Controller

Posted by Flavio Cysne <fl...@gmail.com>.
If you are using only one JMeter, using a CSV Dataset Config will do what
you want.

If you are using a distributed environment (presuming 10 JMeter slaves and
each onde in a different machine) each file has to have only one line from
the original CSV file.

This shell script should help you to distribute your CSV:

sed -n '1p' original.csv | ssh host:port 'cat > original.csv'

'1p' in sede is used to print the first line of original.csv file. Use '2p'
to print the second and so on.

Hope it helps
Em 01/03/2015 11:07, "Erez Naim" <er...@theneura.com> escreveu:

> Hello all,
>
>
>
> How can I make it in Jmeter that if I am using a loop that take values
> from external text file it will take the next value in the text file for
> each iteration of the Loop controller? For 10 users
>
>
>
> For example: I got 10 users that for each of them I got 10 values which I
> take from external file but I noticed that it will take always the first
> value inside the Loop controller and it won't proceed to the next one, any
> idea how can I solve this problem?
>
>
>
> Thanks!
>
>
>
> Erez Naim  |  QA Lead  |   [image: LinkedIn]
> <http://www.linkedin.com/profile/view?id=34323263>  [image: vCard]
> <http://www.theneura.com/vCards/gilad.vcf>  [image: Twitter]
> <http://twitter.com/#!/giladmeiri/>
>
> [image: cid:image004.png@01D01E1B.5F153500]
>
> EL AL 2 Street | Herzliya
> mobile (+972) 50 9 555 686 | fax (408) 689.1366 | skype erez.neura
>
>
>
> website <http://www.theneura.com/>  |  blog <http://www.startupbitz.com/>
>  |  twitter <https://twitter.com/intent/user?screen_name=theneura>  |  map
> <http://goo.gl/maps/ZRkg5>
>
>
>
>
>

Re: Loop Controller

Posted by SanderW <sa...@performancearchitecten.nl>.
Hi Erez,

Do you have the CSV Data Set Config inside your loop controller?
I just tested it and it works.

Kind Regards,

Sander



--
View this message in context: http://jmeter.512774.n5.nabble.com/Loop-Controller-tp5721872p5721879.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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