You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by shankykurella <sh...@gmail.com> on 2011/11/04 13:00:05 UTC

how to pick data from csv data into for loop http request

hi everyone 

i have a requirement of picking a number from csv and pass it to an http
request sampler... the csv data could be of an 100 rows... 

i successfully performed picking a single row of data from csv and posting
it to the http request sampler... but how shall i proceed for 100 rows of
data 

i tried adding a for loop and added the http request sampler to that for
loop??? but stuck what shall i give for the variables (input variable prefix
and output variable prefix under for loop)

kindly suggest me
regards
shankar k b 


 











i have a requirement of picking a number from a csv and pass it to an http
request which is under for loop

--
View this message in context: http://jmeter.512774.n5.nabble.com/how-to-pick-data-from-csv-data-into-for-loop-http-request-tp4963885p4963885.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: how to pick data from csv data into for loop http request

Posted by shankykurella <sh...@gmail.com>.
@daluu 
yes the single request in the middle of the test has to read data from csv
file, so as you suggested i will use CSVRead function.... iam planning to
simulate the load of 3 different users who will be accessing the application 
so can you kindly suggest me how should i design 
my test plan so that i can pick there login details and related post data of
each user  from csv... 

regards 
shankar k b

--
View this message in context: http://jmeter.512774.n5.nabble.com/how-to-pick-data-from-csv-data-into-for-loop-http-request-tp4963885p4970215.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: how to pick data from csv data into for loop http request

Posted by David Luu <ma...@gmail.com>.
You need to clarify your test. So I assume the single request in the middle
reads from CSV file, no need to repeat/loop this single request where it
is. But on next iteration or loop of the thread group (i.e. the test), you
want to read the next CSV row? If this is the case, you can use the CSVRead
function (with next option), as Konstantin mentioned, in some
element/sampler perhaps even within the single request sampler itself,
where the variable value is to be used. On next test iteration, it can then
read the next row. Don't think you need a while controller an counter for
this.

And is your test only for a single thread/user or do you plan to use
multiple users/threads for the thread group? If multiple, how should the
CSV file come into play? All users to read from same CSV file and same
rows, meaning each user starts at row 1 at beginning of test, no uniqueness
of data across users? Or a different intended setup? You may have a problem
for multiple users if using the CSV config element, as it typically passes
different rows for each thread. So thread 1 gets row 1, thread 2 gets row
2. And on next test iteration of thread group, it increments so thread 1
gets row 3, thread 2 gets row 4, so I believe. Not sure how the CSVRead
function comes into play for multiple threads.

On Fri, Nov 4, 2011 at 5:26 AM, shankykurella
<sh...@gmail.com>wrote:

> i have a thread group which includes a set of requests... which includes a
> particular user logging into the application and doing some task (posting
> data into the application)... accessing the csv data is for a single
> request
> which is in the middle of the thread group, so am confused in declaring the
> thread group count .... kindly give me explain me in detail
>
> i declared the number in the thread group... but it is not picking the data
> ( it is picking only for the first instance...) i need to go back to csv
> file and delete the first row and run the jmeter again to move to the next
> row
>
>
>
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/how-to-pick-data-from-csv-data-into-for-loop-http-request-tp4963885p4963932.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: how to pick data from csv data into for loop http request

Posted by sebb <se...@gmail.com>.
On 4 November 2011 12:26, shankykurella <sh...@gmail.com> wrote:
> i have a thread group which includes a set of requests... which includes a
> particular user logging into the application and doing some task (posting
> data into the application)... accessing the csv data is for a single request
> which is in the middle of the thread group, so am confused in declaring the
> thread group count .... kindly give me explain me in detail
>
> i declared the number in the thread group... but it is not picking the data
> ( it is picking only for the first instance...) i need to go back to csv
> file and delete the first row and run the jmeter again to move to the next
> row

There's an example CSV test script in the bin/examples directory.

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


Re: how to pick data from csv data into for loop http request

Posted by shankykurella <sh...@gmail.com>.
i have a thread group which includes a set of requests... which includes a
particular user logging into the application and doing some task (posting
data into the application)... accessing the csv data is for a single request
which is in the middle of the thread group, so am confused in declaring the
thread group count .... kindly give me explain me in detail 

i declared the number in the thread group... but it is not picking the data
( it is picking only for the first instance...) i need to go back to csv
file and delete the first row and run the jmeter again to move to the next
row 



 

--
View this message in context: http://jmeter.512774.n5.nabble.com/how-to-pick-data-from-csv-data-into-for-loop-http-request-tp4963885p4963932.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: how to pick data from csv data into for loop http request

Posted by "Konstantin S." <mk...@gmail.com>.
If you need to load them all at once, you can do it in While Controller
using CSVRead function and reading in each turn one line (there is "next"
option for CSVRead function).

WC
Counter
Java request with CSVRead function

If you need one value for one thread - set up number of threads in your
thread. This will read new line on each thread execution. Or use WC with
CSVRead


On Fri, Nov 4, 2011 at 2:00 PM, shankykurella
<sh...@gmail.com>wrote:

> hi everyone
>
> i have a requirement of picking a number from csv and pass it to an http
> request sampler... the csv data could be of an 100 rows...
>
> i successfully performed picking a single row of data from csv and posting
> it to the http request sampler... but how shall i proceed for 100 rows of
> data
>
> i tried adding a for loop and added the http request sampler to that for
> loop??? but stuck what shall i give for the variables (input variable
> prefix
> and output variable prefix under for loop)
>
> kindly suggest me
> regards
> shankar k b
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> i have a requirement of picking a number from a csv and pass it to an http
> request which is under for loop
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/how-to-pick-data-from-csv-data-into-for-loop-http-request-tp4963885p4963885.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
>
>