JMeter不会从CSV文件中读取带引号的CSV列表 [英] JMeter won't read list of quoted, CSVs from a CSV file

查看:347
本文介绍了JMeter不会从CSV文件中读取带引号的CSV列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用JMeter支持功能性API测试,并且遇到了从CSV文件读取数据的问题.来自文件的数据用于构建POST数据主体,其中包含以下内容:

Using JMeter to support functional API testing and have run across a problem with reading data from a CSV file. The data from the file is used in building a POST data body which contains something like this:

"wibbles" : ${wibble-var},

从CSV文件中读取

${wibble-var},其格式为:

${wibble-var} is read from a CSV file and has the format :

["wibble1","wibble2","wibble3"]

...列表中有超过1000个摆动值.

... there are over 1000 wibble values in the list.

如果"wibbles" : ["wibble1","wibble2","wibble3"]...被硬编码到POST正文中,那么JMeter会很高兴,建立POST请求并开展业务,但是事实证明,即使使用上面的3值示例也无法创建CSV文件,JMeter会解析. JMeter会跳过包含"CSV读取"的线程,而不会构建或发送POST请求,因此没有响应可供检查,并且类似地跳过了Debug Sampler.我听说有传言说加倍引用可以奏效,但找不到正确的语法.任何人都可以在这个问题上发表意见吗?谢谢

If "wibbles" : ["wibble1","wibble2","wibble3"]... is hard-coded into the POST body, then JMeter is happy, builds the POST request and does the business, but it's proved impossible to create a CSV file with even the 3 value example above, that JMeter will parse. JMeter skips the thread containing the 'CSV read' without building the POST request or sending it, so there's no response to examine, and a Debug Sampler is similarly skipped. I've heard rumours that doubling up the quotes can work but haven't been able to find the right syntax. Can anyone throw any light on this issue? Thanks

推荐答案

如果可以获取"wibble1,wibble2,wibble3"&如果在CSV data set config

Double quotes will work if you can get "wibble1,wibble2,wibble3" & if you set Allow quoted data to true in CSV data set config

您可以获取此值,然后使用beanshell预处理程序将其转换为格式"wibble1","wibble2","wibble3".

You can get this value and then use beanshell preprocessor to convert to the format "wibble1","wibble2","wibble3".

如果要直接使用"wibble1","wibble2","wibble3"格式,可以将\t用作分隔符&.相应地修改CSV文件中的数据.

If you want to get in this format "wibble1","wibble2","wibble3" directly, you can use \t as the delimiter & modify the data in the CSV file accordingly.

这篇关于JMeter不会从CSV文件中读取带引号的CSV列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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