Writing the same Python helpers across multiple Locust tests is brittle and slow. The Library lets you create shared Python modules—small, reusable functions you can import across all your tests—to keep your performance suite DRY and consistent.
Security header misconfigurations aren't just technical oversights—they create real vulnerabilities that expose your users to XSS attacks, clickjacking, and data breaches. But manually checking security headers across every page? That's time-consuming and error-prone at scale. LoadForge can check them all for you!
Build once, reuse everywhere: the LoadForge Library
TLDR: The LoadForge Library allows you to create reusable Python modules for Locust performance tests, enhancing consistency, speed, and reliability by centralizing helper functions and reducing copy-paste errors.
•2 min read
Build once, reuse everywhere: the LoadForge Library
Writing the same Python helpers across multiple Locust tests is brittle and slow. The Library lets you create shared Python modules—small, reusable functions you can import across all your tests—to keep your performance suite DRY and consistent.
What it is
Reusable Python modules stored in LoadForge
Auto-synced to your load generators at /root/library
Auto-added to sys.path, so you can import with standard Python imports
In the UI, click “New Library File,” name it (e.g., helpers.py), edit code with syntax highlighting, then Save. You can edit or delete files anytime; updates are picked up on the next run.
Why it’s useful
Consistency: Centralize auth, data builders, custom checks, and utilities
Speed: Import once, reuse across projects and teams
Reliability: Reduce copy‑paste errors and keep logic in one place
How to use in tests
Library files live at /root/library and are on sys.path
Import them in your locustfile.py with standard Python imports