问题描述
我的小组使用JM进行了大量的测试自动化.通常,我们有一个属性文件,其中定义了许多变量.这些又映射到用户定义的变量",其中我们有许多不同的集合.
在jmx的其余部分中都引用了这些-我发现很难,因为在这么多不同的地方有太多的变量来知道什么是什么.有什么方法可以让jmeter显示其变量具有的值-自定义采样器可以吗?如果您只需悬停一个var并显示其值,则理想情况下id喜欢它.
有什么想法吗?
Jmeter的最新版本具有一个出色的采样器,称为调试采样器",它将为您显示以下值:Jmeter变量,Jmeter属性或系统属性. >
您可以在脚本中的任意位置插入它们,以在给定时间获取值.您需要启用查看结果树"以查看采样器.
鉴于Jmeter在运行时从文件中声明了变量,您将无法获得理想的解决方案.
我很好奇...使用"CSV数据集配置"而不是从属性文件中填充用户定义的变量"会更干净吗?
添加了有关变量声明和CSV询问问题的说明.
My group does a lot of test automation with JM. Typically we have a properties file which has a bunch of variables defined. These in turn are mapped to "User Defined Variables" of which we have a number of different sets.
These are in referenced throughout the rest of the jmx - I find it difficult as there are so many variables in so many different places to know what is what. Is there any way to have jmeter display what values its variables have - custom sampler is fine ? Ideally id love it if you could just hover a var and have its value displayed.
Any ideas ?
The newest versions of Jmeter have a fantastic sampler called "Debug Sampler" that will show you the values for: Jmeter Variables, Jmeter Properties or System properties.
You can insert them wherever you want in the script to get values at a given time. You'll want to have a "View Results Tree" enabled to view the sampler.
Given that Jmeter declares variables from a file on run, you won't be able to get your ideal solution.
I'm curious...would it be cleaner to employ "CSV Data Set Config" rather then populating "User Defined Variables" from a properties file?
Edit: Added explanation on variable declaration and asked CSV question.
这篇关于jmeter-显示变量的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!