JMeter environment specific configuration

后端 未结 8 658
时光取名叫无心
时光取名叫无心 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条回答
  •  梦毁少年i
    2021-02-04 13:36

    I have the same problem. My current approach is to have several user defined variable (UDV) elements, e.g., DevVariables, TestVariables, etc. Each of these have the same variables defined (hostname, port, etc.). Then I manually disable those UDV elements that aren't in use.

    Edit:

    The JMeter User Manual states - "The User Defined Variables element lets you define an initial set of variables, just as in the Test Plan. Note that all the UDV elements in a test plan - no matter where they are - are processed at the start." I'm not sure what event constitutes the "start", but it makes it sound like you can't conditionally include UDVs, at least not via controllers.

    You may be able to have a single UDV per test plan, where you set the various variables (host, etc.). Maybe you can set each variable's value using an ugly JavaScript function that keys off of a passed-in property value.

    You might try asking the question on the Apache JMeter User mailing list. There must be a way to do what you want.

提交回复
热议问题