如何使用jmeter为每个线程使用不同的CSV [英] How to use different CSV for each thread using jmeter

查看:751
本文介绍了如何使用jmeter为每个线程使用不同的CSV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是jmeter的新手.我的情况就像有多个用户想要登录并根据特定于该用户的id执行搜索.

I am new to jmeter. My scenario is like there are multiple users who wants to login and perform a search based on id's specific to the user.

例如,

user1将具有100个ID,并将其放入user1.csv
user2将再有100个ID,并将其放置在user2.csv

user1 will have 100 id's and placed it in user1.csv
user2 will have another 100 id's and placed it in user2.csv

每个用户都必须搜索csv文件中可用的每个ID.

Each user have to perform a search for each id available in the csv file.

因此,我已将请求放置在循环控制器中,并且对于单个用户来说效果很好.但是,如果我为2个用户运行,则两个线程都指向user1.csv.如何使user2引用user2.csv.

So I have placed my request in loop controller and it works fine for single user. But if i run for 2 users, both thread refers to the user1.csv. How to make user2 to refer user2.csv.

请建议我如何在jmeter中实现这一目标?还是有其他其他方法可以做到这一点?由于是jmeter的新手,请提供详细的说明.我想为100位用户提供此功能.

Kindly suggest me how to achieve this in jmeter? Or is there any other different approach to do it? Please provide detailed explanation since am new to jmeter. I want to chk this for 100 users.

提前谢谢!

推荐答案

如果要让100个用户(线程)每个使用一组不同的变量,一个非常简单的解决方案是使用一个CSV文件(每行5个ID)和100行是这样的:

If you want 100 users (threads) to each use a different set of variables a very simple solution would be to have a single CSV file with 5 IDs per line and 100 lines like this:

ID1, ID2, ID3, ID4, ID5
  1,   9,   2,   5, 20
 33, 212,   7,   8, 22

...等等

这里是有关如何使用JMeter CSV数据集配置的博客:
http://community.blazemeter.com/knowledgebase/articles /65138-using-csv-data-set-config

Here's a blog on how to use the JMeter CSV data set config:
http://community.blazemeter.com/knowledgebase/articles/65138-using-csv-data-set-config

这篇关于如何使用jmeter为每个线程使用不同的CSV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆