You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Richard Gaywood <ri...@gmail.com> on 2013/11/12 16:35:07 UTC

Counting loops through a CSV file

Hey list,

Am I missing an easy way to do this?

I have a CSV file with a number of params in it, and in my test I want to
be able to make some of the fields unique across CSV repetitions with a
suffix determined by the number of times I've looped through the file.

So suppose my CSV (simplified) had:

abc
def
ghi

I want to generate in the test

abc_1
def_1
ghi_1    <hit EOF>
abc_2
def_2
ghi_2    <hit EOF>
abc_3
def_3
ghi_3

I thought I could set up a counter to run parallel to my CSV loop, but that
won't work unless I increment it by 1/n each iteration, where n is the
number of lines in my CSV file. Which you can't do because counters are
integers.

I'm going to go flail around and see if I can come up with a solution, but
in case I'm not successful, has anyone got any suggestions?

Cheers, Richard

Re: Counting loops through a CSV file

Posted by ZK <st...@gmail.com>.
Adding to Flavios suggestion, you could try:


${csv_field_value}_${__threadNum()}_${__machineName()}_${__time("hh:mm:ss",today)}



ZK



--
View this message in context: http://jmeter.512774.n5.nabble.com/Counting-loops-through-a-CSV-file-tp5718669p5718675.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


Re: Counting loops through a CSV file

Posted by Flavio Cysne <fl...@gmail.com>.
all you want is an unique field value?

${csv_field_value}_${__threadNum()}_${__machineName()}

or

${__UUID()}


2013/11/12 Richard Gaywood <ri...@gmail.com>

> Hey list,
>
> Am I missing an easy way to do this?
>
> I have a CSV file with a number of params in it, and in my test I want to
> be able to make some of the fields unique across CSV repetitions with a
> suffix determined by the number of times I've looped through the file.
>
> So suppose my CSV (simplified) had:
>
> abc
> def
> ghi
>
> I want to generate in the test
>
> abc_1
> def_1
> ghi_1    <hit EOF>
> abc_2
> def_2
> ghi_2    <hit EOF>
> abc_3
> def_3
> ghi_3
>
> I thought I could set up a counter to run parallel to my CSV loop, but that
> won't work unless I increment it by 1/n each iteration, where n is the
> number of lines in my CSV file. Which you can't do because counters are
> integers.
>
> I'm going to go flail around and see if I can come up with a solution, but
> in case I'm not successful, has anyone got any suggestions?
>
> Cheers, Richard
>