Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save a file with dynamic value in Jmeter

Tags:

jmeter

I am trying to save response xml-file with dynamic value using a variable.
I am passing a value through a variable which is got from CSV Data Set Config (e.g. var = Abc123).

I have mentioned the filename prefix as D:\response\${var} where var is my variable.

But the file is getting saved as ${var}.xml itself, instead of Abc123.xml.

Please suggest if there is any way to save the file with dynamic value.
Thanks.

like image 327
user1838298 Avatar asked Jan 24 '26 20:01

user1838298


1 Answers

We are speaking about Save Responses to a file listener, right?

So you have to either:

1. double back-slashes in Filename prefix field:

D:\\response\\${var}

because a single backslash in this case will be taken as 'escape' character and variable will be not expanded to its value;

or:

2. define D:\response\ part elsewhere in the script as separate variable e.g. ${responsePath} and replace D:\response\ in Filename prefix field with this variable:

${responsePath}${var}

Both variants will work correctly but the 2nd one seems to be a bit more general.

like image 105
Aliaksandr Belik Avatar answered Jan 29 '26 18:01

Aliaksandr Belik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!