How to get value from property in BeanShell (jmeter)

22.1k views Asked by At

I have got several thread groups. I want to use variable from the first group. In second group this var should be used in BeanShell. So: in first thread group I created BeanShell Assertion with this code:

 ${__setProperty(erroriden, ${erroriden1})};

In second thread group I have BeanShell pre-processor. If has line like this:

String[] erroriden = (vars.get("erroriden")).split(",");

I tried some variations like this:

String[] erroriden = (vars.get("__property(erroriden)")).split(",");
String[] erroriden = (vars.get("${__property(erroriden)}")).split(",");

but it doesn't work. Please help to use ${__property(erroriden)} in BeanShell pre-processor.

1

There are 1 answers

3
Dmitri T On BEST ANSWER

In the first Thread Group:

props.put("erroriden", vars.get("erroriden1"));

In the second Thread Group:

String[] erroriden = props.get("erroriden").split(",");