I want to make a load test that will read a file and randomly choose a number 1 - 100 and that is the id the request will use.
in my script I have...
String[] split = new String[0];
try(
BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream("/Users/tyeman/programming/jmeter-test/src/ids.txt"), StandardCharsets.UTF_8))){
String line;
while((line=br.readLine())!=null){
split=line.split(",");
}
ads = Arrays.asList(split);
} catch (IOException e) {
throw new RuntimeException(e);
}
for(String id : ads){
log.info("id " + id);
vars.put("ids", id);
}
in my http request I have a post request with a body of
{ "id": "${id}",
"time": "${timeStamp}"
}
I have a Foreach controller but when I put the http-request, scripts etc under it I get
2022-09-19 16:41:24,717 WARN o.a.j.c.TransactionController: Could not fetch SamplePackage
2022-09-19 16:41:24,717 WARN o.a.j.c.TransactionController: Could not fetch SamplePackage
2022-09-19 16:41:24,718 INFO o.a.j.t.JMeterThread: Thread finished: ThreadGroup 1-8
2022-09-19 16:41:24,718 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[ThreadGroup 1-8,6,main]
java.lang.StackOverflowError: null
But if I everything under the transaction controller

I do not get any errors but I do not think the ForEach controller is working correctly.
In the end I want the test to choose a random id from my known id file in order to get a successful response from the endpoint.

