Next Practical Step
Open View Results Tree, switch the dropdown to JSON Path Tester, and verify your query against the actual response body.
Fix JMeter JSON Extractor and Regex Extractor returning default values or NOT_FOUND. Troubleshoot PostProcessor scoping, JSONPath syntax, and correlation.
When extracting dynamic values (such as OAuth tokens, session IDs, or transaction IDs) to use in subsequent requests, downstream requests fail with HTTP 401, 403, or 400, and Debug Sampler shows:
token_var=NOT_FOUND# Or the variable is not replaced at all in the outgoing request:Authorization: Bearer ${token_var}The Extractor failed to capture the target value and fell back to the configured Default Value (or left the variable undefined).
Extractors fail when:
$.token instead of $.data.token).| Cause | Component | Why it happens |
|---|---|---|
| Scoping set to “Main sample only” | JSON / Regex | Target response came from a redirect (HTTP 302 -> 200) located in a sub-sample |
| Wrong Field to check | Regex / Boundary | Extractor is checking “Body” when the token is inside “Response Headers” (e.g. Set-Cookie, Location) |
| Unescaped regex characters | Regex Extractor | Special characters (., [, ], ?, $) not escaped in regex template |
| Array indexing in JSONPath | JSON Extractor | Querying $.items.id on an array instead of $.items[0].id or $.items[*].id |
| Variable name typos | Downstream | Extractor created variable authToken, but downstream sampler calls \${authtoken} (case-sensitive) |
Never guess regex or JSONPath queries in your head. Use JMeter’s built-in interactive testers:
$.data.user.jwtToken) and click Test. JMeter will highlight the exact matches and match counts.If your request performs HTTP redirects (302/301) or downloads embedded resources:
Set-Cookie or Location header, select Response Headers (not Body).In JMeter, PostProcessors execute only after their parent or preceding sampler finishes:
✅ CORRECT (Scoped to Sampler A only): - HTTP Request (Sampler A) └─ JSON Extractor (Extracts token from Sampler A) - HTTP Request (Sampler B - uses ${token})
❌ WRONG (Scoped to all samplers, may overwrite variable with empty match): - JSON Extractor - HTTP Request (Sampler A) - HTTP Request (Sampler B)To verify what variables exist at each point in execution:
JMeter Variables: true.| Resource | Use when |
|---|---|
| Regex Extractor Builder | Interactive browser-based regex pattern builder |
| Correlation & dynamic values | Complete guide to CSRF and token extraction |
| 401/403 after recording | Handling authentication failures |
| Functions and variables | Variable syntax and built-in functions |
0: Random match from all matching results.1: First match.-1: Extract all matches into an array (var_1, var_2, … and var_matchNr).\${my_var}?JMeter only replaces \${my_var} if a variable with that exact name exists. If the variable was never created or has a typo, JMeter sends the literal text \${my_var} in the HTTP request.