Skip to end of metadata
Go to start of metadata

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, and define the 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.

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