When it comes to introducing random variability within test plan execution, there are two similarly named plugins for JMeter which are up to the task. Each of these applies randomization to your tests, but in different ways. In this brief post, we will analyze the similarities and differences between the JMeter Random Controller and the Random Order Controller.
The Random Controller is one of two built-in logical controllers for randomization. When you add an instance of this controller to your test plan, you may nest multiple child elements (e.g., HTTP Requests) underneath this. Each time an iteration of your test plan runs, the Random Controller will select one of these elements at random and execute it. This is in contrast to the Random Order Controller. While the premise remains that child elements are added to this controller, each iteration of your test will run all contained elements. The order in which these elements are executed however will change each time at random.
Let’s consider the following sample test plan. Here we have added a Random Controller side-by-side with a Random Order Controller to explore how child HTTP Requests will be executed:
On one iteration, the Random Controller will select either Sampler A or Sampler B for execution – but not both. On that same iteration the subsequent Random Order Controller will reorder the execution of both Sampler C and Sampler D such that either runs first, followed by the other. A series of three consecutive iterations of this test plan may yield the following execution ordering:
Did you know that RedLine13 offers a full-featured, time-limited free trial? Sign up now, and start testing both controllers.