I have an array of strings that looks like this. This code is in a beanshell sampler in a setup thread which is why i'm using props.put() instead of vars.put().
String [] priceList = {"$472.56","$432.98","$200.98","$765.32","$233.98"};
props.put("price_list", priceList);
Then the test moves on to the main thread group, where each user is assigned a random value from the array in a beanshell sampler:
var priceList = props.get("price_list");
var priceRandomIndex = ThreadLocalRandom.current().nextInt(0, priceList.length);
vars.put("price", priceList[priceRandomIndex]);
Users then make a post request with "price" as a parameter, referenced as ${price} in the sampler component. Results tree shows that the request is made with incorrect values that look like this:
24233.98
24765.32
24472.56
The problem occurs when Jmeter tries to get ${price} during the request. Log confirms that the variable has the correct value up to that point. I realise that the problem is that the dollar sign makes jmeter call some function on the variable which returns a different value. How can I get the original value when jmeter calls ${price}?
