I am trying to run some tests, using jmeters random beanshell post processor, but somehow, randomly it fails to create the numbers and instead posts "variable=${variable_value}" directly in the url.
Here is the sample beanshell post processor code:
import java.util.*;
r = new Random();
b = new Random();
t = new Random();
random_param1 = r.nextInt(415000);
random_param2 = b.nextInt(200);
random_param3 = t.nextInt(25);
vars.put("random_param1",random_param1.toString());
vars.put("random_param2",random_param2.toString());
vars.put("random_param3",random_param3.toString());
And here how I set those for the url:
And the simple test results looks like this:
And this is a failed test request data:
POST test_url
POST data:
param1=%24%7Brandom_param1%7D¶m2=%24%7Brandom_param2%7D¶m3=%24%7Brandom_param3%7D
While the successful ones are like:
POST test_url
POST data:
param1=287341¶m2=107¶m3=20
Any ideas why random generation fails "randomly" like this? Should I use a specific sampler?
EDIT: