0
votes

I have a summary report as part of a reusable module in jmeter and would like to parameterize the output file name of this report, so that I have my own report for each of my ThreadGroups/Tests.

The testplan looks like this:

enter image description here

this is the summary report:

enter image description here

In my Test ThreadGroups I set the property testName in a BeanShell sampler:

import org.apache.jmeter.util.JMeterUtils;
JMeterUtils.setProperty("testName", "test1");

The print testName sampler looks like this:

print(props.get("testName"));

and correctly prints the following to the console:

test1
test2

But I only get one output report named results/test2/report.jtl that includes all results.


It gets even weirder when I run jmeter in the non-GUI mode (-n), because the output will be saved to: results/1/report.jtl

1

1 Answers

0
votes

Quote from http://jmeter.apache.org/usermanual/functions.html:

Properties are not the same as variables. Variables are local to a thread; properties are common to all threads, and need to be referenced using the __P or __property function.

So you have to put the test name into a variable, not into a property.