Files
Htmx/Testing/stress-test-01/README.md
T

985 B

stress-test-01

C# .NET console app that launches 20 Playwright Chromium instances, navigates to the deployed URL, and clicks a button every 200ms.

Defaults

  • URL: prompted from user input every run
  • Instances: 20
  • Interval: 200 ms
  • Button selector: button:visible (first match)
  • Headless: true

Run

cd Testing/stress-test-01
dotnet restore
dotnet build
./bin/Debug/net10.0/.playwright/node/linux-x64/node ./bin/Debug/net10.0/.playwright/package/cli.js install chromium
dotnet run

PowerShell alternative:

pwsh bin/Debug/net10.0/playwright.ps1 install chromium

The app will prompt:

Enter target URL:

Optional overrides

Use either environment variables or CLI args:

  • INSTANCE_COUNT or --instances=<value>
  • CLICK_INTERVAL_MS or --intervalms=<value>
  • BUTTON_SELECTOR or --selector=<value>
  • HEADLESS or --headless=<true|false>

Example:

INSTANCE_COUNT=20 CLICK_INTERVAL_MS=200 dotnet run