0
votes

In this case there is a thread group (Thread Group 1) under which I am calling a GraphQL request. Now say this thread group is executed for 5 threads. For each of these requests say a particular field 'id' is extracted from the response and is written in a .txt file. Logic for this write operation is written inside a beanshell post processor. Now there is another thread group (Thread Group 2). In this I have a bean shell sampler inside which I have written the logic to read this .txt file. There is a for each controller in this thread group. Under this controller there is a graphQL request. This GraphQL request must be called for each of the 'id' (which is stored in a .txt file in Thread 1). Now the challenge over here is that the GraphQL request under Thread 2 has a field by the name say 'email'. This request was earlier executed for only 1 'email' but now I need to execute this for 5 different 'email'. Which means that I need to parameterize this field. Now if I keep the loop count as 1 in Thread Group 2 and store all the 5 emails in a CSV file and execute then only the 1st email is picked from the CSV file. In another case if I change loop count to 5 then Thread Group 2 is executed 25 times because we have a for each controller as well. How do I address this issue. My requirement is that if say Thread Group 2 is executed for 100 threads and we have 5 emails in the CSV file then the 1st 5 threads should use emails 1 to 5 then for thread 6 to 10 should again use emails 1 to 5 and the cycle should continue.click to see image

1

1 Answers

0
votes

Put your CSV Data Set Config which reads emails under the ForEach Controller, this way it will read the next email on each iteration of the ForEach Controller according to JMeter Scoping Rules

Also I recall that you were repeatedly told to use JSR223 Test Elements and Groovy language, if you're not paying attention to the community recommendations and official JMeter documentation maybe it worth choosing another way of looking for support?