🧪

Load Testing Script Generator

Generate load test scripts to validate API performance under stress

Intermediate🧪 TestingAll Models
prompt template
Generate load tests for this API:

**Endpoints:**
[LIST_ENDPOINTS — e.g.,
  "POST /api/auth/login — authenticate user"
  "GET /api/products?page=1&limit=20 — list products"
  "POST /api/orders — create order"
]

**Target:** [TARGET — e.g., "100 concurrent users, 500 req/sec sustained for 10 minutes"]
**SLA:** [SLA — e.g., "p99 < 200ms, error rate < 0.1%"]

Generate:
1. **k6 test script** — complete script with scenarios and thresholds
2. **Realistic user flow** — simulate actual user journeys (login → browse → purchase)
3. **Ramp-up pattern** — gradual increase to avoid cold-start skew
4. **Data generation** — random but realistic test data for each request
5. **Assertions** — response time percentiles, status codes, error rates
6. **Soak test variant** — long-running test to detect memory leaks
7. **Results interpretation** — how to read the output and identify bottlenecks

Include the complete k6 script ready to run.

How to Use This Prompt

  1. 1Copy the prompt template above
  2. 2Paste into Claude, ChatGPT, or Cursor
  3. 3Replace [bracketed placeholders] with your specific project details
  4. 4Iterate on the AI output to refine and customize the results