jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Limotte <mslimo...@gmail.com>
Subject How to pull multiple lines from a file and join them for use in a single HTTP request
Date Tue, 12 Jan 2010 17:27:53 GMT
Hi,

I'm looking for some suggestions on how to pull a random number of lines
from a file and concatenate them together for a single HTTP request.  In a
bit more detail:

I have a CSV file (two columns, but I'm only interested in the first
column) with almost 200,000 lines.  Each line contains a unique id.  I then
want to pull a random number of ids (between 1 and 60), join them with a
comma delimiter and make an HTTP request with the whole string.

For example, the file might contain:

http://rest.acme.com:8888/items/130,127,2,97
or
http://rest.acme.com:8888/items/127,26,31

Where 130, 127, 2, etc; are ids pulled from the file.

I can pre-sort the file randomly if I need to, so reading the lines in the
file in sequence is not a problem.

I tried a number of approaches using a CSV Data Set, or __CSVRead.  In
general, my approach was to use a Loop controller with a random number as
the "Loop Count"; and then use a BeanShell Pre-Processor or a UserParameters
expression to concatenate the values.  I tried using a variable and using a
property.  But none of this worked... it seems that the values created
inside the loop are not available to the HTTP request outside the loop.

Any suggestions on how I might be able to do this.

Marc

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message