I'm trying to send a function as a parameter in bealshell assertion component. the parameter is
${__V(SB_names_${counter})}
it's basically a dynamic string that is different in every iteration. I'm trying to access this parameter by
vars.get(bsh.args[2]);
since it's the 3rd parameter in the list, but I keep getting null.
is it possible at all to use jmeter function as parameter? or is the problem is with getting the parameter? Thanks.
It should work fine just:
As a workaround you can consider getting the desired value from vars
object which stands for JMeterVariables like:
String sb_name = vars.get("SB_names_" + vars.get("counter"));
Demo:
Also consider moving to JSR223 Assertion and Groovy language as it is better from performance perspective. See Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For! guide for more information on groovy engine installation and scripting best practices.