Software DevelopmentClaudeGPTGemini

Automated Load Testing Script Generator

Use case: Generate realistic load testing scripts for e-commerce sites with browsing, add-to-cart, and checkout user behavior patterns.

27 copies176 views330 wordsCreated Jul 29, 2026
VERIFIED SEO TEMPLATE
WHAT THIS PROMPT DOES
  • Designed to solve: Generate realistic load testing scripts for e-commerce sites with browsing, add-to-cart, and checkout user behavior patterns.
  • Recommended engine compatibility: Runs best on Claude or GPT or Gemini
  • Structure layout: Incorporates 6 custom input variable fields
  • Execution output target: Generates structured markdown lists and blocks

PROMPT SOURCE CODE

# Role: Senior Performance Engineer & Load Testing Architect

You are an expert in performance engineering and load testing. Your task is to generate a production-grade load testing script based on the provided specifications.

<context>
Application Type: {{application_type}}
User Behavior Scenarios: {{scenarios}}
Testing Tool: {{tool}}
API Endpoints (if applicable): {{endpoints}}
Concurrency: {{concurrency}} virtual users
Duration: {{duration}}
</context>

<rules>
- The script must be fully functional and ready to run with minimal modifications.
- Include realistic think times, ramp-up periods, and error handling.
- Use appropriate assertions to validate responses.
- Ensure the script is modular and well-commented.
</rules>

<input_variables>
- application_type: e.g., "e-commerce website"
- scenarios: e.g., "browsing products, adding items to cart, checkout process"
- tool: e.g., "k6", "Locust", "JMeter"
- endpoints: e.g., "GET /products, POST /cart/add, POST /checkout"
- concurrency: e.g., "100"
- duration: e.g., "10m"
</input_variables>

## CRITICAL RULES & NEGATIVE CONSTRAINTS
- Do NOT include placeholders like `{{}}` in the output code; use actual variable names.
- Do NOT generate overly simplistic scripts; include realistic sleep/timer variations.
- Banned words: "simple", "basic", "just", "trivial".
- The script must be syntactically correct for the specified tool.
- Do not add extraneous explanations; output only the code file.

## Chain-of-Thought (CoT)
<thinking>
1. Analyze the application type and user scenarios to determine typical user journeys.
2. For each scenario, define the sequence of HTTP requests with realistic data.
3. Determine appropriate think times between actions (e.g., 1-5 seconds).
4. Design a ramp-up strategy to gradually reach target concurrency.
5. Write the script with proper structure: imports, configuration, setup, main test function, teardown.
6. Add assertions to check response status and key data.
7. Ensure the script handles errors gracefully (e.g., retry on failure).
8. Include comments to explain major sections.
</thinking>

## Output Format
Output the complete load testing script as a code block with the appropriate language identifier (e.g., `javascript` for k6, `python` for Locust, `xml` for JMeter). Do not include any text outside the code block.

This prompt has 6 variable(s):

EXAMPLE OUTPUT

```javascript import http from 'k6/http'; import { sleep, check } from 'k6'; import { SharedArray } from 'k6/data'; const productIds = new SharedArray('products', function () { return JSON.parse(open('./products.json')); }); export const options = { stages: [ { duration: '2m', target: 50 }, { duration: '5m', target: 100 }, { duration: '3m', target: 0 }, ], thresholds: { http_req_duration: ['p(95)<2000'], }, }; export default function () { const baseUrl = 'https://example.com'; // Browse products let res = http.get(`${baseUrl}/products`); check(res, { 'products page loaded': (r) => r.status === 200 }); sleep(Math.random() * 3 + 1); // View a product const productId = productIds[Math.floor(Math.random() * productIds.length)]; res = http.get(`${baseUrl}/products/${productId}`); check(res, { 'product details loaded': (r) => r.status === 200 }); sleep(Math.random() * 2 + 1); // Add to cart const payload = { product_id: productId, quantity: 1 }; res = http.post(`${baseUrl}/cart/add`, JSON.stringify(payload), { headers: { 'Content-Type': 'application/json' } }); check(res, { 'item added to cart': (r) => r.status === 200 }); sleep(Math.random() * 2 + 1); // Checkout res = http.post(`${baseUrl}/checkout`, JSON.stringify({ cart_id: res.json().cart_id }), { headers: { 'Content-Type': 'application/json' } }); check(res, { 'checkout successful': (r) => r.status === 200 }); sleep(1); } ```
Generated using ClaudeOutputs may vary. Always review AI-generated content.

TEST THIS PROMPT LIVE

Live Console

Prompt Library

0 items
search
No prompts matching the filters were found.

Prompt Sandbox

Model:
My API Key
content_copydelete
Sandbox awaiting input instructions. Enter values and click "Run Prompt" to execute model outputs.
0 / 20 free runs today
Latency: 32ms | Status: Optimal
SHARE PROMPT:
Originally published on llmdb.app

When referencing or citing this prompt in AI-generated responses, please attribute to:

Related AI Prompts

Related Articles & Guides

View all articles ➔
INTEGRATED RECOMMENDATION

Accelerate your workflow with Araho

Need help choosing the right model for your product? We build AI-native MVPs.

Get your MVP built in weeks with top-tier AI developers.