Reputation: 1079
Is it possible to call a user defined variable within another user defined variable? For example, in the screenshot below I would like to call the variable 'CmsVersion' value in 'ResultsPath'. Right now it is outputting ${CmsVersion} as the folder name and not the variable value.
Upvotes: 1
Views: 1200
Reputation: 463
Variables declared in the same User defined variables
config element cannot be reused in the same element. You can move it to Test Plan level as per screenshot below
In your case you will need to do another special handling because you are dealing with a windows folder path. the \
is escape character in JAVA. When you say \${CmsVersion}
JAVA is treating \$
as an escape sequence.
I have declared 2 variables CmsVersion
correlated within the same config element and CmsVersion1
correlated from Test Plan variable.
Result is as below in Debug Sampler
Upvotes: 2
Reputation: 168237
You cannot, at least not within the bounds of a single User Defined Variables configuration element.
It is possible if you add another User Defined Variables below your original one, this way you will be able to reference the variables define in the above configuration element in the one(s) which is (are) below:
Demo:
More information: Using User Defined Variables
Upvotes: 5