0

Can anyone tell me how I can loop over the same CSV file twice without having to stop the thread?

Currently I have

Thread Group
+-- While Controller
    +-- CSV (True,True,False)
        Loop Controller (2)
        +-- SOAP/RPC Request

So the idea is to retrieve 5 requests and then repeat the same 5 request again.
NOTE: i do not want to send the same request twice.

4
  • You want to repeat the requests, but don't want to send the same request twice? That seems like a contradiction. Commented Oct 29, 2012 at 18:10
  • No, I want to sent my five requests, once end of the file then resend them again. i dont want to sent e.i. request 1 twice before sending req. 2,3,4 & 5 Commented Oct 29, 2012 at 18:23
  • That's what I eventually decided you must have meant. See my answer below for a suggested configuration Commented Oct 29, 2012 at 18:31
  • Got the answer? Commented Nov 9, 2012 at 11:53

1 Answer 1

1

Assuming your question means: "I want to reuse the data set, but do not want to send the same request concurrently.", then you should be able to set up the following configuration. You shouldn't need a while loop.

Thread Group
* Loop Count = 2
* Thread Count = 5
|
+-- CSV 
    * Recycle on EOF = true
    * Stop thread on EOF = false
    * Sharing mode = All threads

To break that down:

  • The Loop count on the Thread Group will run the entire thread group the specified number of times, with 5 threads, each one of which will make one request from your CSV file
  • The "Recycle" and "Stop thread" settings on the CSV Data Set config will cause the data set to be reused until the threads have completed.

Another way of accomplishing this is to set up a loop count as a multiple of the number of URLs you are going to sample:

Thread Group
* Loop Count = 10
* Thread Count = 1
|
+-- CSV 
    * Recycle on EOF = true
    * Stop thread on EOF = false
    * Sharing mode = All threads

That's slightly less efficient, since it means the requests have to execute serially rather than in parallel threads, but it is another way of doing it.

Sign up to request clarification or add additional context in comments.

1 Comment

What if one day OP decided to add the 6th request? Coupling the CSV line count with JMeter test plan is not optimal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.