Run test elements in random order
Overview
To run test elements in random order...
- Put each element under a random selector
- Select the proportion of time that the element should be run
For example, you can record a test that includes...
- logging on to a system
- browsing through items in the system
- buying various items
- totaling the order
In this case, you could run the logging in and the totaling scenarios once, but put the browsing and buying scenarios under a random selector.
Put a test element under the control of a random selector
- Double-click a test
- Select a test element and then click...
Insert | Random Selector
Use Shift+Click to select multiple elements.
- When asked whether to move the selected elements into a new random selector, click Yes.
Click No to insert an empty random selector into the test.
To set whether or not elements are moved automatically, or whether you are prompted, click...
Window | Preferences | Test | Test Editor | 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, a window is displayed...
Create weighted blocks
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
To determine the likelihood that a block will be executed, add the weights together and divide the weight for each block by that total.
For example, with...
- 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
The total of the weights is: 1 + 1 + 2 + 5 + 5 + 9 = 23. Therefore, the statistical likelihood of selection is:
Weight Likelihood 1 1/23 = 0.0435 (4.35%) 2 2/23 = 0.0870 (8.70% ) 5 5/23 = 0.2174 (21.74%) 9 9/23 = 0.3913 (39.13%) Note that a higher weight increases the likelihood, but does not guarantee, that a block will be executed. Some variation might occur.
For example, if you run a test 23 times, you cannot predict that the first and second blocks will execute exactly once, the third block exactly twice, the fourth and fifth blocks exactly five times, and the sixth block exactly nine times. However, the more times that the blocks are executed, the more accurate this prediction is.
Related
- About test variables
- Add test elements
- Editing Kerberos tests
- Search within tests
- Disabling portions of a test or schedule
- Rename test assets
- Delete test assets
- Provide tests with variable data (datapools)
- Viewing binary data
- Correlating response and request data