Conduits
Conduits are Nidra's powerful test flow system that allows you to chain multiple requests together, extract variables from responses, and validate API behavior with assertions.
What is a Conduit?
A Conduit is an automated sequence of HTTP requests that execute in order. Think of it as a test script or workflow that:
- Executes requests sequentially
- Extracts data from responses to use in subsequent requests
- Validates responses with assertions
- Simulates complex user workflows
- Automates integration testing
Use Cases
Conduits are perfect for:
- Authentication flows: Login → Get token → Make authenticated request
- CRUD operations: Create resource → Read it → Update it → Delete it
- Multi-step workflows: Create user → Verify email → Complete profile
- Integration testing: Test complete business processes
- Data setup: Prepare test data for manual testing
Creating a Conduit
- Navigate to "Conduits" in the sidebar
- Click "New Conduit"
- Give your conduit a name
- Add steps to your conduit
- Configure each step
- Click "Save"
Conduit Steps
Each step in a conduit can be:
- Request: Execute an HTTP request
- Delay: Wait for a specified time
- Variable: Set or modify variables
- Assertion: Validate response data
- Script: Custom JavaScript logic (advanced)
Request Steps
The most common step type executes an HTTP request:
- Select an existing request from a collection
- Or create a new request inline
- Configure variable extraction
- Add assertions
Variable Extraction
Extract data from responses to use in later steps:
Example: Extract user ID from response
{
"id": 12345,
"email": "user@example.com"
}
Extract id as {{userId}} to use in subsequent requests.
Assertions
Validate that responses meet expectations:
- Status code is 200
- Response contains specific data
- Response time is under threshold
- Headers are correct
Running Conduits
Execute your conduit:
- Click "Run Conduit"
- Watch the steps execute in sequence
- View results for each step
- Review any failed assertions
Execution Results
After running a conduit, you'll see:
- Overall success/failure status
- Results for each step
- Response data and timing
- Assertion results
- Extracted variables
Advanced Features
Conditional Steps
Execute steps based on conditions:
- Skip steps if previous step failed
- Branch based on response data
- Retry failed steps
Loops
Repeat steps multiple times:
- Iterate over arrays
- Poll until condition is met
- Stress testing
Data-Driven Testing
Run the same conduit with different data sets:
- CSV file import
- JSON data arrays
- Variable substitution
Conduit Variables
Variables in conduits have their own scope:
- Conduit variables: Temporary variables that exist during execution
- Extracted variables: Data pulled from responses
- Environment variables: From the active environment
Variables can be:
- Set at the start of the conduit
- Extracted from responses
- Modified during execution
- Saved to the environment after completion
Best Practices
- Keep conduits focused: One conduit per workflow or test scenario
- Use descriptive names: For both conduits and steps
- Add assertions liberally: Validate assumptions at each step
- Handle errors gracefully: Plan for failure scenarios
- Document your conduits: Explain what the conduit tests and why
- Clean up after yourself: Delete test data created during execution
Debugging Conduits
When a conduit fails:
- Check the step that failed
- Review the request and response
- Verify variable values
- Check assertion logic
- Run individual steps manually
Scheduling Conduits
Run conduits on a schedule for continuous testing:
- Hourly, daily, or weekly execution
- Monitor API health
- Catch regressions early
Next Steps
- Build your first conduit with our tutorial →
- Learn about variable extraction →
- Master assertions →
- Check the conduit steps reference →