JMeter-多个用户从CSV文件中获取唯一行 [英] JMeter - multiple user taking unique row from CSV file

查看:591
本文介绍了JMeter-多个用户从CSV文件中获取唯一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于这个主题,我读了很多答案,但是找不到适合我的答案.

I read many answers around regarding this topic, but I couldn't find the right one for me.

要求:

  1. 我有2个线程/用户
  2. 我在CSV数据集配置中有两个条目用于登录.

用户数将始终与CSV行相同.

The number of users will always be the same as the CSV rows.

我的测试如下:

线程组

  1. 主页
  2. 循环控制器
  3. -登录
  4. ------ CSV DataSetConfig
  5. [另一个http通话]

如果我将线程数2设置为2,并将Loop设置为2,则进入树:

If I set number of threads 2 and Loop to 2 I get in Tree:

  • 首页1
  • 登录user1
  • 登录user2
  • 主页2
  • 登录user1
  • 登录user2

如果我将线程数设置为2并将Loop设置为1,则会得到:

If I set number of threads to 2 and Loop to 1 I get:

  • 首页1
  • 登录user1
  • 主页2
  • 登录user1

如果我将线程数设置为1并将Loop设置为2,则会得到:

If I set number of threads to 1 and Loop to 2 I get:

  • 首页1
  • 登录user1
  • 登录user2

我还尝试将CS​​V数据集放在登录调用之前的线程组中.如果我将2个用户设置为开始流程,请始终从CSV中选择第一行.

I also tried to put the CSV Data set in the thread group before the login call. If I set 2 users to start the flow, always pick the first row from CSV.

我需要什么:

  • 首页1
  • 登录user1
  • 主页2
  • 登录user2
  • 每个用户都应继续进行操作

我可以尝试使用特定的用户登录名设置两个线程组,但这是不可行的,因为我想增加用户数量并且无法维护. 总的来说,我有4个流程和200个用户.解决此问题后,我将考虑用户的可变性.

I could try to setup two Thread groups with specific user login, but it's not feasible because I want to increased the number of users and it's not maintainable. As an overview, I have 4 flows and 200 users. After I solve this problem I will think about the user variability.

如果有人知道该怎么做或可以向我指出正确的信息,请这样做. 非常感谢.

If anybody knows how to do it or can point me to the right info, please do so. Thanks a lot.

推荐答案

只需删除循环控制器,然后将csv文件放在测试计划的顶部.然后在Login语句之后设置一个同步计时器,并将其设置为最大用户数.

Just remove your loop controller, and put your csv file at the top of the testplan. Then set a synchronizing timer after the Login statement and set it to the max users.

现在,如果有足够的权限,所有用户都应使用与csv值不同的值登录,再加上他们将同时继续等待所有用户先登录.

Now all your users should login with a different value from csv value if there are enough, plus they will all continue at the same time waiting for all to login first.

这篇关于JMeter-多个用户从CSV文件中获取唯一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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