How to remove hardcoding in the below code?
<stringProp name="Authorization.username">user123</stringProp><stringProp name="Authorization.password">pwd123</stringProp>
user123 It seems a job for User Defined Variables.
As you can see here:
https://jmeter.apache.org/usermanual/functions.html at par 20.3 Referencing a variable in a test element is done by bracketing the
variable name with '${' and '}'. So basically something like ${jmxUsr} and ${jmxPwd} in your test script.
How to parameterize username and password in jmeter?
34 views
Asked by
Rashmi Ks
At
There are 2 answers
On
Values can be assigned in "Test Plan" or "Thread Group" (right click till "User Defined Variables" )
You can use __P() function to read the credentials from JMeter properties.
When you run JMeter test in command-line non-GUI mode you will be able to pass the credentials via
-Jcommand-line arguments like:More information: