jmeter

Unable to get the property set in one thread from another thread


I am setting a property in setUp thread group using ${__setProperty()} and trying to use the same in another thread using ${__property()}

But I get the error which does not give any details. "Error invoking bsh method : eval Sourced file : inline evaluation of"

I just need the value retrieved from a query to be available for the rest of the threads, any suggestion?enter image description here


Solution

    1. Don't use Beanshell for scripting, since JMeter 3.1 it's recommended to use JSR223 Test Elements and Groovy language
    2. Don't inline JMeter Functions or Variables in Groovy scripts, you should rather use propsandvars` shorthands instead

    Something like:

    props.put("tran_id", vars.getObject("max_transaction_id").get(0).get("id").trim())
    

    should do the trick for you

    More information: Using JMeter Variables With Multiple Thread Groups