Running tests in random order
A schedule that contains only user groups and tests will run each test in a user group sequentially. By adding a random selector to a schedule, you can repeat a series of tests in random order, thus emulating the varied actions of real users.
Procedure
-
In the Test Navigator, browse to the schedule and double-click
it.
The schedule opens.
- Click the name of the schedule element to contain the random selector, and then click .
-
In the Schedule Element Details area, add the number of
iterations to loop.
Think of yourself as a "random selector." You are blindfolded, and you have a bucket that contains 10 red balls and 10 green balls. You have a 50% chance of picking a red ball, and a 50% chance of picking a green ball. You pick a ball randomly—it is red. You then replace the ball in the bucket. Every time you pick a ball, you have a 50% chance of getting a red ball. Because the ball is replaced after each selection, the bucket always contains 10 red balls and 10 green balls. It is even possible (but unlikely) that you will pick a red ball every time.
-
Set the weight of the random selector. The weight determines
the statistical probability that a specific element will be selected.
Assume that a random selector contains two tests: Browse and Bid. You assign Browse a weight of 7 and Bid a weight of 3. Each time the loop is processed, Browse has a 70% chance of being selected, and Bid has a 30% chance of being selected.
Example
For example, assume a selector contains six blocks set to the following weight:
- two blocks set to a weight of 1
- one block set to a weight of 2
- two blocks set to a weight of 5
- one block set to a weight of 9
Weight of block | Likelihood of block being selected |
---|---|
1 (two blocks) | 1/23. = 0.0435, or about 4.35% (for each block) |
2 | 2/23 = 0.0870, or about 8.70% |
5 (two blocks) | 5/23 = 0.2174, or about 21.74% (for each block) |
9 | 9/23 = 0.3913, or about 39.13% |