Search code examples
jmeterjmeter-pluginsbeanshell

jmeter use multiple BeanShell PostProcessor parametrs in http request


Could anyony explain how to do such task?

In my testStep I have a BeanShell PostProcessor. It returns a list of n elements. (each time number of elemets is different) I wonder, is it possible to run some equal http requests that will use that elements?

for example, Processor returned var1,var2,var3 then it'd be three http request:

  .../get-smth$var=var1
  .../get-smth$var=var2
  .../get-smth$var=var3

I realised that I'd use a size in order to put it as variable in loop controller, but how to apply variables to http request?


Solution

  • Leo, probably an array + a foreach controller can solve your problem. Take a look at this section of the JMeter manual

    Regarding the variables, you can include almost anywhere... for example, if you want to include var1 into your resquest; just refer it as ${var1}. Something like http://mydomain/doSomethingWith.php?variable=${var1} Also pay attention to multidimensional variables (arrays); ie var1_1 will give you the first element