Running test elements in random order
You can record multiple user scenarios in a test and then run each scenario in a random order. To do this, you put each scenario under a random selector and then select the proportion of time that the scenario should be run.
About this task
Procedure
- In the Test Navigator, browse to the test and double-click
it.The test opens.
- Click the test element that will be controlled by the random
selector, and then click .Use Shift+Click to select multiple elements.
- You are asked whether you want to move the selected elements
into a new random selector. Click Yes.
Click No to insert an empty random selector into the test.Note: To set whether or not elements are moved automatically, or whether you are prompted, click , and click the General tab.
- Set the weight of the random selector. The weight determines
the statistical probability that a specific element will be selected.
- If you have added a number of test elements, the Create weighted blocks window is displayed. You can select adjacent elements and group them. Each element—whether in a group or by itself—must be weighted.
- If you have added only one test element, the weighted block is displayed in the Test Element Details area with a default of 1.
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% |