jmeter CSV变量,指的是另一个CSV

发布于 2025-01-31 12:46:11 字数 375 浏览 1 评论 0原文

在Jmeter中,我已经定义了两个CSV数据集配置。 第一个包含一些列:

Name, Surname, Adress, ....

在第二列中,我想配置一个从第一个CSV数据集中获取值的列:

SecondName = ${Name}, Age, ...

对于第二名,我尝试了这些值,但是没有有效的结果:

${Name}
${__evalVar(Name)})
${__eval(${Name})}
${__V(${Name})}
${__groovy(vars.get("Name"))}

请您帮助我解决求解这个问题?

谢谢, 卡洛

In Jmeter I've defined two CSV Data Set Config.
First one contains some columns:

Name, Surname, Adress, ....

In the second one I would like configure a column that takes the value from the first CSV Data Set Config:

SecondName = ${Name}, Age, ...

For the SecondName I've tryied these values, but no valid result:

${Name}
${__evalVar(Name)})
${__eval(${Name})}
${__V(${Name})}
${__groovy(vars.get("Name"))}

Please could you help me to solve this issue?

Thanks,
Carlo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゞ花落谁相伴 2025-02-07 12:46:11

你不能。

看看 jmeter noreferrer“> jmeter test test test test Elements执行

0. Configuration elements
1. Pre-Processors
2. Timers
3. Sampler
4. Post-Processors (unless SampleResult is null)
5. Assertions (unless SampleResult is null)
6. Listeners (unless SampleResult is null)
  • 顺序因此,元素是在其他任何内容之前初始初始化的,
  • 它将读取变量
  • 当线程(虚拟用户)执行采样器时, /具有该值的值,

该解决方案将迁移到 __ csvread()请参阅 jmeter运行时文章以获取更多详细信息。

You cannot.

Take a look at JMeter Test Elements Execution Order

0. Configuration elements
1. Pre-Processors
2. Timers
3. Sampler
4. Post-Processors (unless SampleResult is null)
5. Assertions (unless SampleResult is null)
6. Listeners (unless SampleResult is null)
  • CSV Data Set Config is a configuration element therefore it's initialized before anything else
  • The variable is being read when a thread (virtual user) executes a Sampler
  • So your 2nd CSV Data Set Config is getting the variable value at step 3 and being initialized at step 0 when the variable doesn't exist/has the value yet

The solution would be migrating to __CSVRead() function, see How to Pick Different CSV Files at JMeter Runtime article for more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文