jmeter-java-dsl icon indicating copy to clipboard operation
jmeter-java-dsl copied to clipboard

Add random choice support for WeightedSwitchController

Open KopysovDB opened this issue 5 months ago • 0 comments

WeightedSwitchController.md

Random Choice - on each iteration plugin will choose a random item. This check box can not guarantee that actual percent of child elements execution will equals with expected (delta in tests not more than 0.5%)

  • Added isRandomChoice() method to DslWeightedSwitchController to enable random selection of child elements
  • Added test case to verify random choice functionality

weightedSwitchController() .child(weight1, httpSampler(SAMPLE_1_LABEL, wiremockUri)) .children(httpSampler(SAMPLE_2_LABEL, wiremockUri)) .child(weight2, httpSampler(label3, wiremockUri)) .isRandomChoice()

2025-06-17 00 01 27

KopysovDB avatar Jun 16 '25 20:06 KopysovDB