Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
271 views
in Technique[技术] by (71.8m points)

jmeter - How to loop each thread with unique data from CSV Data Config file

I have CSV data config file with 25 users. When I create a Thread group of 25 users I want each thread to pick one line from CSV Data config and loop around.

So

User1 picks userA
Users2 pick userB.......userN pick user(SomeX)

As I set keep alive so I want to reuse the connection and same set of data on the same socket.

My CSV file Recycle on EOF False
Stop Thread on EOF True
Sharing Mode : Current Thread.

But what I observed is Thread 1-1 User1 picks UserA ( iteration 1) Thread 1-1 User 1 picks User B iteration 2

What I expect is

Thread 1-1 User1 picks UserA ( iteration 1)
Thread 1-1 User 1 picks User A ( iteration 2 )
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

According to your description each JMeter thread will read CSV file independently and separately, i.e.:

  • Thread 1-1 will process all 25 CSV entries defined number of iterations
  • Thread 1-2 will process all 25 CSV entries defined number of iterations
  • etc.

Given you have equal number of lines in CSV file and virtual users it might be better idea setting "Sharing mode" to All threads so each virtual user could pick its own line from the CSV file.

More information:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...