Search code examples
jmeterjsr223parameter-list

What is the correct syntax to supply parameters via the JMeter JSR223 sampler form?


I can't seem to find any docs around this, is it simple as this:

//option 1
${something},${something1}
//option 2
123,234,762

Any help would be much appreciated.


Solution

  • Since JMeter 5.2 the explanation makes more sense, not it looks like:

    Parameters passed to script (exposed as 'Parameters' (type String) and 'args' (type String[]))
    

    So if you want to reference the whole line you provide in the "Parameters" section as a single String just use Parameters.

    If you want to access individual entries (separated by whitespace) you can use args[0] for the first parameter, args[1] for the second, etc.

    Demo:

    enter image description here

    More information on Groovy scripting in JMeter: Apache Groovy - Why and How You Should Use It