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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With