JMeter environment specific configuration

后端 未结 8 774
时光取名叫无心
时光取名叫无心 2021-02-04 13:05

I have several JMeter test plans which should be executed in different environments, say Dev, Test, UAT, Live. In each test plan I would like to have a simple way to specify whi

8条回答
  •  名媛妹妹
    2021-02-04 13:30

    I would suggest to substitute all environment-specific variables or values with JMeter Properties. See following functions for reference:

    • __property()
    • __P()

    For example you can define a property called hostname in either jmeter.properties file or as JMeter command line argument as follows

    jmeter -Jhostname=169.140.130.120 -n -t yourscript.jmx -l yourscriptresults.jtl
    

    and refer to in inside your script as:

    • ${__P(hostname,)} or
    • ${__property(hostname,,)}

    See Apache JMeter Properties Customization Guide for more details.

提交回复
热议问题