3
votes

I'm new to jmeter.

I understand that I can edit jmeter.properties and specify the names of "custom" variables that jmeter will save into its output files, for any given test run.

I've edited jmeter.properties to include this line:

sample_variables=DURATION

and I've also edited my test plan to include a Regular Expression Extractor that extracts a value from each response and stuffs it into a variable of that name.

enter image description here

I also added a "Simple Data Writer" to tell jmeter to write the data it collects to a file.

enter image description here

The output file gets created successfully, but it does not contain the variable I extracted.

What am I doing wrong?

I'm finding this impossible to google, because "save jmeter variable" doesn't constrain the situation nearly enough.

1

1 Answers

2
votes

My bad.

Jmeter was writing that variable out. I had to restart jmeter to get it to work.

I was misled by looking at the top of the output file - it contained output from a prior run, prior to my restart of the tool. After I Removed the existing output file, the new content in the output file showed the variable I expected.