JMeter:如何在多个线程组循环中重用/重新打开 CSV? [英] JMeter: How to reuse/reopen a CSV in several Thread-Group-Loops?

查看:33
本文介绍了JMeter:如何在多个线程组循环中重用/重新打开 CSV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 JMeter 中,我有一个 CSV 用户列表,每个用户都应该上传一定数量的文件.这些文件在第二个 CSV 中列出.每个用户都必须上传所有文件.由于服务器不能同时处理所有线程,我将线程组设置为使用 X 个用户并循环 Y 次,以便最终所有用户上传所有文件.

In JMeter I have a CSV list of users, and each of these users is supposed to upload an amount of files. The files are listed in a second CSV. Each user must upload all files. Since the server can't handle all threads at once I set the Thread group to use X users and loop Y times, so that in the end all users upload all files.

 Test plan
 - CSV Data Set Config (contains users) --> Recycle = false, Stop thread on EOF = false
 - Thread Group (X users, Y loops)
 - - While Controller ( ${__javaScript("${uploadFile}"!="<EOF>")} )
 - - - CSV Data Set Config (contains files) --> Recycle = false, Stop thread on EOF = false
 - - - HTTP Request (upload file)

对于第一个循环,一切正常:启动了 X 个线程.在每个线程中,文件-CSV 被打开,每个用户上传所有文件.然后第二个线程组循环开始,下一个用户从用户 CSV 中取出,但是当这些线程进入包含文件 CSV 的 while 循环时,它们不会上传任何内容.似乎他们重新使用了第一个循环中的 files-CSV,并将 CSV 视为 EOF 或类似的东西.

For the first loop this all works OK: X threads are started. In each of the threads the files-CSV is opened and each users uploads all files. Then the second Thread-Group-loop starts, the next users are taken from the users-CSV, but when those threads come to the while-loop containing the files-CSV, they don't upload anything. It seems like they re-use the files-CSV from the first loop, and consider the CSV to be EOF or something like that.

例如,3 个线程/用户和 2 个循环的结果如下所示:

As an example, the results with 3 threads/users and 2 loops looks like this:

**first loop**
user 1
  upload file 1
  upload file 2
  upload file 3
user 2
  upload file 1
  upload file 2
  upload file 3
user 3
  upload file 1
  upload file 2
  upload file 3
**second loop**
user 4
user 5
user 6

第二个循环的用户也应该通过文件-CSV 并上传文件.知道我做错了什么吗?提前致谢!!

The users from the second loop should also go through the files-CSV and upload the files. Any idea what I am doing wrong? Thanks in advance!!

推荐答案

看起来我们遇到了同样的问题.我找到了答案.答案很长,所以我不能在这里添加.但你可以找到答案这里

looks like we ran into the same problem. I've found the answer. The answer is long so I cannot add it here. But you can find the answer here

这篇关于JMeter:如何在多个线程组循环中重用/重新打开 CSV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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