I am trying to assign a Jmeter variable to another variable in BeanShell Sampler using vars.put("End", vars.get("homeEnd"));
. And I am using ${End}
variable in the Throughput Controller to represent percentage throughput. But getting the following error in the logs:
jmeter.control.ThroughputController: Error parsing ${End} java.lang.NumberFormatException: For input string: "${End}" at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) at sun.misc.FloatingDecimal.parseFloat(Unknown Source) at java.lang.Float.parseFloat(Unknown Source) at org.apache.jmeter.control.ThroughputController.getPercentThroughputAsFloat(ThroughputController.java:168) at org.apache.jmeter.control.ThroughputController.decide(ThroughputController.java:203) at org.apache.jmeter.control.ThroughputController.iterationStart(ThroughputController.java:239) at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:405) at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:397)
The error you are getting normally means that
End
variable is not defined. I would suggest using Debug Sampler and View Results Tree listener to check yourhomeEnd
andEnd
variables values after your Beanshell Sampler Execution, if everything goes well they both should have the same non-empty value.It also worth checking jmeter.log file to see any Beanshell-related errors.
See How to Debug your Apache JMeter Script article for more information on JMeter scripts troubleshooting.