jmeter中带有file1.csv和file2.csv的嵌套循环 [英] nested loop with file1.csv and file2.csv in jmeter

查看:27
本文介绍了jmeter中带有file1.csv和file2.csv的嵌套循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Apache JMeter,我需要在由 csv 数据文件驱动的 2 个嵌套循环中运行函数调用.如何在jmeter中实现嵌套循环? 但它不是基于数据文件.

I am using Apache JMeter and I need to run function call in 2 nested loops driven by csv datafiles. There is similar Q&A at How to implement nested loop in jmeter? but it's not based on datafiles.

我有 2 个文件:

long.csv:

1
2
3
...
100.000

short.csv:

a
b
c

我需要使用这些文件中的数据运行嵌套循环测试

I need to run nested loop test with data from those files

foreach x from long.csv
  foreach y from short.cvs
    call(x,y)

我希望调用看起来像这样:

and I want the calls look like this:

call(1,a)
call(1,b)
call(1,c)
call(2,a)
call(2,b)
call(2,c)
call(3,a)
call(3,b)
call(3,c)
...
call(100000,a)
call(100000,b)
call(100000,c)

调用可能会重新排序,但我需要对每个输入组合进行唯一调用.

The calls may be reordered, but I need unique call on every combination of inputs.

建议?

推荐答案

如果您正在寻找详细步骤,请查看此处.

If you are looking for detailed steps, please check here.

http://www.testautomationguru.com/jmeter-looping-2-csv-文件/

我试过 &它似乎有效 - 请查看以下快照了解详情.

I tried & it seems to work - Please check below snapshot for details.

CSV 数据集配置 1 读取 csv 文件 - var ref 名称为vara".它有 10 行,1-10

CSV Data set Config 1 reads a csv file - the var ref name is 'vara'. it has 10 rows , 1-10

CSV 数据集配置 2 读取另一个 csv 文件,包含 3 行 a、b c - 并且 var ref 名称为varb".允许 EOF 上的 ReCycle?"设置为 True.

CSV Data set Config 2 reads another csv file , contains 3 rows a, b c - and the var ref name is 'varb'. 'Allow ReCycle on EOF?' is set to True.

线程循环计数用于 CSV 数据集配置 1
内循环控制器的循环计数用于 CSV 数据集配置 2

Thread Loop Count is for CSV Data set Config 1
Inner Loop Controller's loop count is for CSV Data set Config 2

这篇关于jmeter中带有file1.csv和file2.csv的嵌套循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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