I am trying to use the return value from beanshell sampler, later in the while condition ${__javaScript(${homeState}<6)}
.
When i run and check logs, ${homeState}
is not getting replaced with the beanshell sampler homeState integer value.
Can any one suggest what's wrong going on?
however, when i check the response of beanshell sampler in view results tree, it is returing integer as expected.
return
keyword in Beanshell defines Beanshell sampler response data. If you need to store the value into a JMeter Variable you should replace the linereturn homeState
with the following expression:vars
is a shorthand to JMeterVariables class instance, it provides read/write access to the JMeter Variables in scope.See How to Use BeanShell: JMeter's Favorite Built-in Component article for comprehensive information on using Beanshell scripting in JMeter tests