Jmeter - weighted random values?

前端 未结 4 651
执念已碎
执念已碎 2021-01-14 00:32

How can I go about running tests/controllers based on random weight? For instance, have two tests, one with a weight of 25%, the other with 50%. The one with 50 should run t

4条回答
  •  误落风尘
    2021-01-14 01:26

    For some simple weightings you can use the fact the switch controller defaults to the first child to your advantage. Eg 50% 25% 25% like so

    Switch Controller - ${__Random(0,3)}
     - Child 0 (and 3)
     - Child 1
     - Child 2
    
    • http://jmeter.apache.org/usermanual/component_reference.html#Switch_Controller
    • http://jmeter.apache.org/usermanual/functions.html#__Random

    You take this one step further by grouping tasks in Random and Simple controllers as the children.

提交回复
热议问题