Reputation: 1
i need to pass variable(Extracted from response) from one thread to another Response:"16540$Add373" i need digits before $ RegEx: Ref Name:SFID regex:"[$] Template:$1$ MatchNo:1
I've used beanshell assertion to set variable in to jmeter property
${_setProperty(SFID1,${SFID})};
While executing i'm getting
Assertion failure message: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``${_setProperty(SFID1,${SFID})};'' : Attempt to access property on undefined variable or class name
Upvotes: 0
Views: 10730
Reputation: 168207
Correct syntax is:
${__setProperty(SFID1,${SFID},)}
I recommend using Function Helper Dialog to generate functions as you can easily get confused with all these round and curly brackets.
Another approach is using vars
and props
pre-defined Beanshell variables like:
props.put("SFID1", vars.get("SFID"));
where:
See How to Use BeanShell: JMeter's Favorite Built-in Component guide for extended information on Beanshell scripting in JMeter
Upvotes: 1