Hi If I remember correctly Pre processors wont work unless you have atleast one sampler . The way around this is a. Use a Bean Shell Sampler instead (will show up in the results though) b. Use a TestActionSampler (this is a dummy sampler which will allow you to attach your Pre Processor)
regards deepak On Tue, Jan 12, 2010 at 10:52 AM, Marc Limotte <[email protected]> wrote: > Hi Deepak. > > Thanks for correcting me. After adding a Debug Sampler as you > suggested, I see now that the loop only works if the Sampler exists. > So, I've gotten my test plan to work... but only if the Debug Sampler > is included and enabled. Do you know why that is? I don't want to > leave Debug on, b/c of it's impact on the testing performance. > > I did verify that there are no errors in jmeter.log. Here is the > structure of my test: > > Thread Group > Random Variable > Loop Controller (loop count is the Random Variable) > Only Once > BeanShell Pre Proc ( vars.put("mylist",""); ) > *DebugSampler > CSV Data Set Config > BeanShell Pre Proc ( concats the last value from the CSV to > "mylist" ) > *DebugSampler > HTTP Sampler ( uses the variable ${mylist} ) > View Results Tree > > Again, if I disable either of those DebugSamplers, it stops working. > > Marc > > > On Tue, Jan 12, 2010 at 9:35 AM, Deepak Shetty <[email protected]> wrote: > >> 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 > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

