← All Prompt Categories

📚 LLM HUB · 3 PROMPTS

Correlation & Dynamic Values

3 copy-ready AI prompts for correlation & dynamic values in JMeter, k6, and Gatling. Part of the JMeter.AI LLM Hub.

Identify Correlation Candidates

I have the following HTTP response from my application:
[Paste response headers and body]

Identify all values that need to be correlated (extracted and reused in subsequent requests). For each:
- What the value is (session token, CSRF token, ViewState, redirect URL, etc.)
- Where it appears in the response (header / body / cookie)
- How to extract it in JMeter (Regular Expression Extractor / JSON Extractor / CSS/JQuery Extractor / Boundary Extractor)
- Where it is used in subsequent requests
- Extraction regex or JSONPath expression

Output as a table: Field | Location | Extractor Type | Expression | Used In

JMeter Extractor Configuration

Generate JMeter extractor configurations for the following dynamic values:

1. JWT token from response body JSON path: $.data.token
2. CSRF token from HTML form input field named "_csrf"
3. Redirect URL from Location response header
4. Order ID from response body: "orderId":"12345"

For each, provide:
- Correct extractor type (JSON / Regex / CSS / Boundary / XPath)
- Full JMX XML snippet
- Variable name
- Default value
- Scope (main sample only vs sub-samples)

OAuth2 / JWT Token Handling

My application uses OAuth2 with JWT tokens. The flow is:
1. POST /oauth/token with client_id, client_secret, grant_type
2. Extract access_token from response
3. Use Bearer ${access_token} in all subsequent requests
4. Token expires every [N] minutes. needs refresh

Implement this in JMeter:
- Login request with token extraction
- User Defined Variable or setUp Thread Group for token
- Token refresh logic using If Controller + Timer
- Proper scoping so all threads share the token
- JSR223 / Groovy approach if needed for refresh timing