Skip to main content
Below are several practical examples showcasing different browser-testing use cases in LoadForge. All scripts inherit from PlaywrightUser and use the Locust-Playwright integration found in locust_plugins.users.playwright.

1. Basic Navigation & Timing

Navigate through a site and record timings for key page loads.

2. Clicking Elements – Different Strategies

Demonstrates clicking links via text, CSS selector, XPath, and nth-child().

3. Form Submission & Assertion

Login form submission and verification of successful navigation using an assertion.

4. Performance Metric – Largest Contentful Paint (LCP)

Throttle network, load page, and fire a custom request event marking pass/fail based on LCP.

5. Screenshot on Failure

Take a screenshot if a critical element is not visible.

6. Accessibility (Axe) Scan

Run an Axe accessibility scan directly from the browser context.

These scripts should provide a solid starting point for common browser-testing scenarios. Modify selectors, thresholds, and URLs to match your application.