Is there any possibility to pass a value of user defined variable in another user defined variable? How to do this?
I've got a variable (name | value):
version | 5.6
and I want to use it in another one:
config | config_${version}.csv
It does not work because ${version}
is treated as a string not as variable.
I've tried it with __eval
function (the same) and with __P
(then value of variable config
was config1.csv, so ${version}
was treated as a 1
.
I'm using JMeter 3.3.
Notice the warning in User Defined Variables:
the variables are not available for use until after the element has been processed, so you cannot reference variables that are defined in the same element. You can reference variables defined in earlier UDVs or on the Test Plan.
So you can declare version variable to Test Plan
and call it using __V function in User Defined Variables:
${__V(config_${version}.csv)}
Another option is to move to User Parameters with similar usage of __V function
For defining variables during a test run, see User Parameters. UDVs are processed in the order they appear in the Plan, from top to bottom.
Note: __P
is used for retrieving JMeter property and not variable
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