Reputation: 51
I am trying to write a JMeter script which can be used on multiple machines. Example :
stringProp name="Argument.value"
7|0|44|https://${server}:8693/cea/ABC_WebClient/|${randomString}|com.test.server.gui.question
/stringProp In above line, i need to pass server and randomString as an external argument. How do I pass those values to script? I cannot define them in CSV file or something to pass an argument.
Upvotes: 0
Views: 2773
Reputation: 168147
You can pass the values to JMeter script via -J
command-line argument like:
jmeter -Jserver=localhost -JrandomString=foobarbaz -n -t test.jmx -l result.jtl
In your .jmx script you can access the values via __P() function like:
7|0|44|https://${__P(server,)}:8693/cea/ABC_WebClient/|${__P(randomString,)}|com.test.server.gui.question
More information:
Upvotes: 1