0
votes

I wrote below given code in Jmeter pre-processor ${__fifoPop(sync_tokensa, gotTokena_1)} ${__fifoPop(sync_tokensaq, gotTokena_2)}

error showing as Response code:500 Response message:javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script394.groovy: 1: unexpected token: @ line 1, column 38. U0pDVVdtaUJRa0xQSEVodzE1MDEyNTM2MzQ=

1

1 Answers

0
votes

As per JSR223 Sampler documentation:

When using this feature, ensure your script code does not use JMeter variables directly in script code as caching would only cache first replacement. Instead use script parameters.

Don't inline JMeter Functions and/or Variables into the Groovy scripts, it may cause either compilation failure or incorrect interpretation or only first value will be used or any combination of all above.

Go for code-based equivalent like:

1.upto(2, { number ->
    vars.put('gotTokena_' + number, kg.apc.jmeter.modifiers.FifoMap.getInstance().pop('sync_tokensaq'))
})

More information: Apache Groovy - Why and How You Should Use It