问题描述
在运行终端URL时,jmeter中出现情况不断变化.
I have a situation in jmeter while running the endpoint url keeps changing.
例如:
URL1 [QA]:Facebook/v1/account2
URL1 [dev]:Facebook/帐户
for example:
URL1 [QA]: Facebook/v1/account2
URL1 [dev]: Facebook/account
有时候端点的url改变了,但是我的脚本却是一样的.在上述情况下如何处理终点更改?
Some times end point url is changing but my scripts are same. How do I handle the end point change for the above conditions?
推荐答案
您应该对qa和dev使用不同的属性值
You should use different property values for qa and dev
您只需在命令行-J中发送其他值即可
You can simply send different value in command line -J
jmeter -Jpath=Facebook/v1/account2 -t your.jmx
然后在路径字段中使用__P函数获取路径属性值:
And then in Path field get path property value using __P function:
${__P(path)}
如果您有多个属性,则可以使用-q添加不同的属性文件,例如:
If you have multiple properties you can add different property files using -q, e.g.:
jmeter -q dev.properties -t your.jmx
您的dev.properties将是
And your dev.properties will be
path=Facebook/v1/account2
这篇关于Jmeter-更改每个环境的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!