I am bit new to Jmeter and in performance testing world. I am bit strugling with best practises with test data where user id and password is saved in .csv file.
I know it is not good parcise to have user id and password in srouce code respository. But how to manage test data if I want to used 10 use id and passowrd for logins in my Jmeter script. I have plan to run these test in pipeline?
Any sugestion?
The best way (in my opinion) is to pass in these values using an environment variable. You can then reference them using
${__P("user_name", "anonymous")}The
__Pfunction is a shortcut for the__propertyfunction: https://jmeter.apache.org/usermanual/functions.html#__propertyThe first parameter is the name of the environment variable, the second is the value to use if that environment variable is not actually set.
If you don't want to use an environment variable, You can also pass the value in from the command line using the -J option:
jmeter -Juser_name="Johnny" -Jpassword="secret"The values are accessed in the same manner using the
__Pfunction.