Sometimes a test scenario cannot be defined precisely because different users choose different website navigation routes. For example, a content management system (CMS) runs a news website. Pages with news articles are created daily, and the corresponding links are updated at the same time. The goal of a load test is to emulate users visiting different pages depending on their interests.

To emulate a click on a random link, create an extractor with a generic search rule for finding a hyperlink.

Examples: This is an example of a regular expression finding a hyperlink: <a\s+href="(?<url>.+?)".*>.*?</a>

This is another example of a regular expression finding a relative hyperlink : <a\s+href="(?<url>[^:]+?)".*>.*?</a>

Then randomize the extractor's Occurrence property so different VUs will extract different URLs. To do so, set the Occurrence Type property to Random. StresStimulus will extract all available URLs and then select one at random. You can define a custom range of links by setting the Min Occurrence and Max Occurrence properties. And finally, use this extractor to parameterize the subsequent request header's {PATH} property.

Since all links are determined dynamically, the same test can be used without re-recording after the website was updated and links were changed. This approach allows creating a large number of random and unpredictable traversing routes that are necessary to test. Combining this approach with random think times allows to realistically emulate the impact of a user-base on server performance and to test a very large number of real-life situations.


If you need to extract a random occurrence of a value from a response, but the total number of occurrences is unknown, leave the Min Occurrence and Max Occurrence properties blank. StresStimulus will determine the total number of occurrences during runtime and automatically pick one at random.

In addition to returning a random occurrence extractor value, it may also be necessary to return the occurrence number. In these situations, you may choose the instance property in the variable picker.

If the extractor has a Random occurrence type, then the variable picker will have 2 options below the extractor:

Occurrence - returns the occurrence of the extractor

OccurrenceZeroBased - returns the occurrence of the extractor that starts from 0 instead of 1.

  • No labels