有没有办法在 CSV 数据集配置中使用“共享模式”的“编辑”选项?我在官方网站上找到了描述?
apache jmeter component CSV Data Set Config
Identifier - all threads sharing the same identifier share the same file. So for example if you have 4 thread groups, you could use a common id for two or more of the groups to share the file between them. Or you could use the thread number to share the file between the same thread numbers in different thread groups.
但是我不明白common id和thread number是什么意思?我如何将它们用于特定线程?
最佳答案
例如,您有包含以下内容的 file.csv
:
line1
line2
line3
line4
和 2 Thread Groups有 2 个用户和 1 个循环执行带有以下标签的采样器:
Sampler ${__threadNum} - ${foo}
对于不同的共享模式设置,您将获得不同的行为,即:
对于共享模式
所有线程
:Sampler 1 - line1 Sampler 1 - line2 Sampler 2 - line3 Sampler 2 - line4
对于共享模式
当前线程组
,您将获得:Sampler 1 - line1 Sampler 1 - line1 Sampler 2 - line2 Sampler 2 - line2
对于共享模式
当前主题
,您将获得:Sampler 1 - line1 Sampler 1 - line1 Sampler 2 - line1 Sampler 2 - line1
对于分享模式
${__threadNum}
你会得到:Sampler 1 - line1 Sampler 1 - line2 Sampler 2 - line1 Sampler 2 - line2
示例 Test Plan :
引用资料:
关于testing - Jmeter如何使用CSV Config Set的共享方式运行线程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42292760/