在JMeter中,您可以指定变量以填写HTTP请求默认值吗? [英] In JMeter, can you specify variables to fill in for an HTTP Request Default?
问题描述
我希望能够从CSV文件(或更理想的情况是使用JMeter读取.properties
文件)中读取值,然后在HTTP Request Defaults
中的多个Test Plan
中将其用作Port Number
/
I'd like to be able to read a value out of a CSV file, or more ideally a .properties
file with JMeter, and then use it in multiple Test Plan
s in the HTTP Request Defaults
as the Server Name or IP
, and the Port Number
/
我想以这种方式进行设置,以便对于可以运行的不同Test Plans
文件夹,可以对任何可以运行的测试进行单点修改.但是${}
变量似乎没有填充在HTTP Request Defaults
中.
I wanted to set it up that way so that for a folder of different Test Plans
that can be run, and there can be a single point of modification for any of the tests that can be run. But the ${}
variables don't seem to populate in the HTTP Request Defaults
.
推荐答案
您可以使用用户定义的属性来执行此操作.可以从文件控制这些用户定义的属性的值.在下面的示例中,我通过一个名为env的用户定义属性来控制脚本需要运行的环境.
You can do this with user-defined properties. The values for those user-defined properties can be controlled from a file. In the following example, I am controlling the environment the script needs to run against by a user defined property called env.
然后,我在http请求默认值中使用它.您可以对任何想要的属性执行此操作
And then, I am using it in the http request defaults. You can do this for any property that you want to
这篇关于在JMeter中,您可以指定变量以填写HTTP请求默认值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!