Running API Tests
Thebru run command executes your API requests and tests from the command line. You can run individual requests, folders, or entire collections.
Basic Usage
Navigate to your collection directory and run:Running Specific Requests
Single Request
Run a specific.bru file:
Folder
Run all requests in a folder:Folder (Recursive)
Run all requests in a folder and its subfolders:Multiple Paths
Run multiple requests and folders:Working with Environments
Using Collection Environments
Run with a specific environment:environments/production.bru (or .yml for OpenCollection format).
Using Environment Files
Load environment from a custom file:.bru- Bruno environment format.json- JSON format.yml/.yaml- YAML format
Global Environments
Use a global environment from a workspace:Overriding Variables
Override specific environment variables:Output and Reporting
JSON Output
Save results as JSON:JUnit XML Output
Generate JUnit-compatible XML for CI/CD:HTML Report
Generate an HTML report:Multiple Reports
Generate multiple report formats simultaneously:Security Options
Custom CA Certificates
Add a custom CA certificate:Client Certificates
Use client certificates for authentication:client-cert-config.json
Insecure Connections
Allow insecure server connections (skip SSL verification):Execution Control
Run Only Requests with Tests
Skip requests that don’t have tests or assertions:Bail on Failure
Stop execution immediately after any failure:Delay Between Requests
Add a delay (in milliseconds) between each request:Tag-Based Filtering
Run only requests with specific tags:Proxy Configuration
Disable Proxy
Disable all proxy settings:JavaScript Sandbox
Choose the JavaScript runtime for scripts:safe(default) - Uses QuickJS for securitydeveloper- Uses Node.js VM for more features
Customizing Reporter Output
Skip Headers
Omit all headers from reports:Skip Request/Response Bodies
Omit request bodies:Cookie Management
Disable automatic cookie handling:Verbose Output
Enable verbose output for debugging:Understanding Test Results
After execution, you’ll see a summary:- Requests - HTTP request execution status
- Pre-Request Tests - Tests run before the request
- Post-Response Tests - Tests run after the response
- Tests - General test results
- Assertions - Assertion results
Common Examples
CI/CD Pipeline
Development Testing
Smoke Tests
Testing with Custom Certificates
Exit Codes
The CLI returns different exit codes for automation:Next Steps
CLI Options Reference
Complete reference of all CLI flags and options
Importing Collections
Import collections from OpenAPI and other formats