views:

25

answers:

1

Running Jmeter on XP, I have the following scenario:

Declare the variable "ServerName" with the value 'serverNameValue'
Declare the a variable "TestResultsFolder" with the value 'c:\results\${ServerName}'
... do samplers ...
Have a simple data writer save result to "${TestResultsFolder}\file"

Unfortunately, The data writer is saving to 'c:\results\${ServerName}' instead of 'c:\results\serverNameValue'

if I put a valid alpha character before the variable, it works: 'c:\results_${ServerName}' yields 'c:\results_serverNameValue'

Thus, it seems that the \ is escaping the variable declaration of $, causing the program NOT to supply the correct value.

Any thoughts on how I might actually obtain c:\results\serverNameValue

+1  A: 

Does the '\' character have to be escaped, in order to explicit that you need a real '\', and not an escape of the next character?

I would try this : "c:\\results\\${ServerName}"

Benoit Courtine
Yes, escaping the '\' worked - Thanks!The final solution was to have to slashes: *C:\temp\\${ServerName}*
BlackGaff
You can also use forward slashes in paths, even on windows. Using `c:/results/${servername}` shoukd work regardless of string escaping.
Jörn Horstmann
Using forward slashes also worked beautifully, thank you.Also, my first comment should read "two slashes". Bah.
BlackGaff