Jmeter - Changing values per environment

扶醉桌前 提交于 2021-01-28 08:44:01

问题


I have a situation in jmeter while running the endpoint url keeps changing.

for example:
URL1 [QA]: Facebook/v1/account2
URL1 [dev]: Facebook/account

Some times end point url is changing but my scripts are same. How do I handle the end point change for the above conditions?


回答1:


You should use different property values for qa and dev

You can simply send different value in command line -J

 jmeter -Jpath=Facebook/v1/account2 -t your.jmx 

And then in Path field get path property value using __P function:

 ${__P(path)}

If you have multiple properties you can add different property files using -q, e.g.:

  jmeter -q dev.properties -t your.jmx 

And your dev.properties will be

 path=Facebook/v1/account2


来源:https://stackoverflow.com/questions/58546799/jmeter-changing-values-per-environment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!