Documentation Index
Fetch the complete documentation index at: https://docs.testsprite.com/llms.txt
Use this file to discover all available pages before exploring further.

What Dynamic Variables Are
A dynamic variable is a value that one test produces and another test uses. The simplest example:user_id isn’t known until POST /users runs. By “dynamic” we mean: it’s resolved at runtime, after the earlier test executes, then carried into the next HTTP call.
Dynamic variables are the connective tissue of Integration Tests and the source data for Auto Cleanup and Data Flow.
Integration Tests
Auto Cleanup
Data Flow
Producers and Consumers
Every test in a chain has one of two roles for each variable:| Role | What it does |
|---|---|
| Producer | Extracts a named value from its response |
| Consumer | Uses a named value (produced earlier) in its request |
id to look up); a POST that creates a record typically produces the new record’s ID.
The Dynamic Variables Tab
Sidebar → Data → Dynamic Variables. This view answers: “Across the most recent run, what values flowed through the system?”| Column | What it shows |
|---|---|
| Tag | Type tag for the captured value (e.g., resource type) |
| Dynamic Variable | Name of the captured variable (e.g., user_id, order_id, session_token) |
| Value | A preview of the actual value captured |
| Source | The producer test (with click-to-navigate to its detail page) |
| Used by | The consumer tests (multiple if shared across chains) |
| Deleted by | The cleanup test that deletes the resource this variable points to, when applicable |
- Search — by variable name
- Filter: Cleanup —
Has cleanup(variables the auto-cleanup chain references) orOrphaned(no matching cleanup) - Filter: Consumer —
Used downstream(have at least one consumer) orUnused - Sort — by Name (default), by Consumers, or by Sources
What Counts as “Cleanup-Relevant”
Some variables represent records that exist in your test environment after the run. These need to be cleaned up so subsequent runs start fresh. TestSprite identifies cleanup-relevant variables by recognizing which ones look like resource handles (record IDs from POST/PUT calls with a matching DELETE endpoint) versus plain values used only for assertions. These flagged variables appear in the Dynamic Variables tab with a populated Deleted by column (and can be filtered via the Cleanup → “Has cleanup” filter). They feed into the cleanup chain.Auto Cleanup
Refining Producer/Consumer Wiring
If a chain is wrong (missing producer, mismatched name, or a path that doesn’t resolve in the response), the recovery path is the per-test Chat on the test detail page — describe what should change and TestSprite regenerates the test.When a Value Isn’t Available
If a test needs a value that wasn’t produced upstream, TestSprite marks it Blocked with the missing variable name in the error trace. The most common causes:The producer test failed (or didn't run yet)
The producer test failed (or didn't run yet)
The producer didn't return the expected field
The producer didn't return the expected field
data.id instead of id). Refine in chat: “Capture user_id from data.id in the response”.Name mismatch — producer says `userId`, consumer says `user_id`
Name mismatch — producer says `userId`, consumer says `user_id`
Producer was unticked at plan-review
Producer was unticked at plan-review
Reusing the Same Variable Across Chains
A variable produced once is available to every test downstream in the run, not just one chain. So:Edge Cases & Troubleshooting
The value I need is in a list, not a single field
The value I need is in a list, not a single field
The response is a JSON array at the root
The response is a JSON array at the root
The endpoint returns the resource but with the ID inside a header (Location)
The endpoint returns the resource but with the ID inside a header (Location)
I see the variable in the Dynamic Variables tab but the consumer still says BLOCKED
I see the variable in the Dynamic Variables tab but the consumer still says BLOCKED
Two tests produce the same variable name from different responses
Two tests produce the same variable name from different responses
order_id_a, order_id_b) if you genuinely need both.