I've got a JMeter test plan that creates a subscription record for a customer. At the moment I need to specify the exact currency to be used, but i'd like to replace this with a variable to automatically pick a currency from a list. We currently use GBP, EUR and USD. I don't know enough about JMeter at the moment to find an easy answer so I do apologise if this is really simple.
Asked
Active
Viewed 1,167 times
0
-
This example perfectly fits your needs http://stackoverflow.com/a/14697370 – Gábor Lipták Nov 20 '13 at 13:42
1 Answers
0
I think that the easiest way is using User Defined Variables
Just add User Defined Variables config element to your Thread Group and populate it as follows:
- currency1 USD
- currency2 EUR
- currency3 GBP
So these are being stored as JMeter Variables.
After somewhere in your test where you need to select a currency you can use following combination:
currency${__Random(1,3,)}
Where currency is a static prefix and ${__Random(1,3,)} is JMeter Random Function which returns a random number from 1 to 3.

Dmitri T
- 159,985
- 5
- 83
- 133