Reputation: 352
How can one pass credentials to the Jmeter command line to be used as username/password for HTTP Authorization Manager username/password? I'm using Jmeter 5.4.
I need to be able to programmatically pull credentials from a vault or Jenkins credentials and pass to Jmeter. Hard coding or writing to a file is not an option.
Upvotes: 0
Views: 1695
Reputation: 168002
Normal way of parameterizing a JMeter test using external data is:
Use __P() function in the HTTP Authorization Manager like:
${__P(username,)}
it will return the username
property value
Pass the username
property to JMeter via -J
command-line argument like:
jmeter -Jusername=johndoe -n -t test.jmx ....
Another option is reading the value from an environment variable using __groovy() function:
${__groovy(System.getenv('username'),)}
or if you have Custom JMeter Functions plugin installed you can do the same using __env() function
${__env(username,,)}
Upvotes: 1