Overview
Customizing headers to fit specific needs is simple with LoadForge. This guide demonstrates how to set up a list of user agents and let each client choose one randomly during the test. This method provides a realistic approach to load testing, simulating different user agents accessing your application. Although our focus in this example is on user agents, the same principle can be applied to other headers, or even for randomly selecting users, paths, and more.Creating and Setting Random User Agents
The example below demonstrates how to:- Define a list of user agents.
- Use the
on_start
method to let each client pick a user agent randomly at the beginning of a test. - Maintain the selected user agent for each client throughout the test duration.
Did you know? LoadForge is built on the powerful locust.io framework. This means if you’re a locust user, you can directly import your scripts into LoadForge to maximize your testing capabilities. Elevate your testing experience with LoadForge!