如何在Jmeter中对CSV数据集配置的文件名文本进行参数化 [英] How to do parameterization for file name text of csv data set config in jmeter

查看:80
本文介绍了如何在Jmeter中对CSV数据集配置的文件名文本进行参数化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将在csv数据集配置中提交的文件名文本的值作为$ {filename}传递,此变量包含完整路径,并从另外一个csv数据集config中获取它,该变量立即存在于线程组和变量中我将其传递到if控制器内部的csv数据集配置中,我无法将该值传递给文件名文本字段,从而出现问题.

I am passing the value for file name text filed in csv data set config as ${filename}, this variable contains entire path and fetching it form one more csv data set config which is present immediate to the thread group and the variable which I am passing to csv data set config that is inside the if controller here I couldn't able to pass that value to file name text filed, getting problem.

推荐答案

CSV数据集配置不能将JMeter变量用作文件名".但是,可以在此处使用 __property 函数.

CSV Data Set Config cannot use JMeter Variable as the "Filename". However it is possible to use __property function there.

因此您的测试计划应如下所示:

So your test plan should look as follows:

  1. 通过第一个CSV数据集配置将一些值读入JMeter变量,即 foo 通过
  1. Read some value into a JMeter Variable i.e. foo via 1st CSV Data Set Config
  2. Convert foo variable into foo property via __setProperty function
  3. Use ${__property(foo,,)} as a "Filename" in 2nd CSV Data Set Config.

有关不同JMeter功能的更多信息,请参见如何使用JMeter功能帖子系列

For more information on different JMeter's functions see How to Use JMeter Functions post series

这篇关于如何在Jmeter中对CSV数据集配置的文件名文本进行参数化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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