How to get unique values using JSR223 Preprocessor in rumtime controller

32 views
Skip to first unread message

Amruta Deokar

unread,
Jun 3, 2024, 5:01:17 AMJun 3
to JMeter Forum
  Hi,

I am using JSR223 preprocessor to read value from csv. i am not storing it in variable as cache checkbox is enabled and i want unique value for each iteration. so i am directly calling using vars.get() method in another sampler.
i want to run that request for 10 mins and rest of the requests for 3 hrs.
so i am using runtime controller for 10 mins. Without runtime controller i am getting unique values for every iteration. as soon as i put my preprocessor under runtime controller values are getting repeated and i m not getting unique onces.

Simpler controller 
agent_no: 6669
agent_session_no: 6898099

agent_no: 6669
agent_session_no: 234567


agent_no: 4567
agent_session_no: 9786766

agent_no: 1367
agent_session_no: 7884762

Runtime controller

agent_no: 6669
agent_session_no: 6898099

agent_no: 6669
agent_session_no: 6898099

agent_no: 4567
agent_session_no: 9786766

agent_no: 4546
agent_session_no: 345576

agent_no: 4567
agent_session_no: 9786766

can someone please help?

DT

unread,
Jun 3, 2024, 10:04:56 AMJun 3
to JMeter Forum
We cannot help you without seeing your CSV file (at least first 2-3 lines) and your Groovy code.

Actually I don't think you need scripting at all, you could go for CSV Data Set Config instead, with its default sharing mode of "All Threads" each user reads next line on each iteration so the data will be "unique"

Amruta Deokar

unread,
Jun 4, 2024, 1:19:42 AMJun 4
to JMeter Forum
Hello,
I am reading agent no from csv file and agent session no is getting generated Randomely in User parameters.

CSV file
AGENT_NO
6669
4567
4546

Preprocessor

PreS.JPG

Reply all
Reply to author
Forward
0 new messages