> 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.
Not true. If you set a variable it is available outside . use a debug
sampler with a view results tree listener to see what values get set and
check you are using the variable in the HTTP request .
If you still cant figure it out , please provide the structure of your test
(for e.g. you might have attached the pre processor to an incorrect
location  , e.g. if it is under a controller then it applies to all elements
in the controller) and finally check jmeter.log to verify that your
beanshell is actually executing without errors.

regards
deepak

On Tue, Jan 12, 2010 at 9:27 AM, Marc Limotte <[email protected]> wrote:

> 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
>

Reply via email to