How can I declare a variable name by using the value of a property?
For example, I have the property propertyName
with the value propertyValue
. I want to declare a variable with the name propertyValue
.
I've tried like ${${__P(variableName)}}
but such constructions doesnt work.
You may need to evaluate the property name, using the ${__V()}
function.
Thus, you'd probably end up with something like ${__V(${__P(propertyName)})}
which would only declare a variable with a null value.
Basics on properties & command line:
if you need to pass variables through the command line, properties are indeed the correct choice.
The flag to set a property is -JpropertyName
The function to read a property is ${__P(propertyName)}
For full details, see:
http://wiki.apache.org/jakarta-jmeter/JMeterFAQ#How_do_I_pass_parameters_into_my_Test_scripts.3F_I_want_to_be_able_to_use_the_same_script_to_test_with_different_numbers_of_threads_and_loops.2C_and_I_don.27t_want_to_have_to_change_the_script_each_time.
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