Key Concepts
Virtual Users (VUs)
Load Patterns
Thresholds
Test Location
How to Create a Single Request Test
Test a single API endpoint with configurable load.Select Single Request Mode
Configure the Request
- Select the HTTP method (GET, POST, PUT, PATCH, DELETE)
- Enter the target URL (e.g.,
https://api.example.com/users) - Click Settings to add headers, query params, request body, or authentication
Choose a Load Pattern
- Constant VUs: Fixed number of users for a set duration
- Ramping VUs: Gradually increase/decrease users over stages
- Per VU Iterations: Each user runs a fixed number of requests
- Constant Arrival Rate: Maintain a fixed request rate regardless of response time
Configure Load Settings
Set Thresholds (Optional)
Select Location
Launch Test
How to Create a Multi-Step Test
Chain multiple API requests to test user flows (login → fetch data → submit form).Select Multi-Step Mode
Add Steps
- Name: Descriptive name (e.g., “Login”, “Get User Profile”)
- URL: The endpoint URL
- Method: HTTP method
- Headers/Body: Request configuration
Configure Variable Extractors
- Source: body, header, or status
- Path: JSONPath expression (e.g.,
$.data.token) - Variable Name: Reference in later steps as
{{variableName}}
Add Assertions
- Status code equals 200
- Body contains specific value
- Response time under threshold
Continue with Load, Thresholds, and Location
Load Pattern Reference
Constant VUs
Runs a fixed number of virtual users continuously for the specified duration.Ramping VUs
Gradually increases or decreases load through defined stages.- Linear Ramp: Gradual load increase
- Spike Test: Sudden load spike then recovery
- Stress Test: Progressive overload to find breaking point
Per VU Iterations
Each virtual user executes the test script a fixed number of times.Constant Arrival Rate
Maintains a constant rate of new requests regardless of response time.How to Configure Request Settings
Click the Settings button to open the configuration drawer.Query Parameters
Add URL query parameters:- Click Add Parameter
- Enter key and value
- Parameters are appended to the URL automatically
Headers
Add custom HTTP headers:- Click Add Header
- Enter header name and value (e.g.,
Content-Type: application/json)
Request Body
For POST, PUT, PATCH requests:- Select body type: JSON, XML, or Text
- Enter the request body content
- JSON is validated before test execution
Authentication
Configure request authentication:Options
How to Set Performance Thresholds
Thresholds define pass/fail criteria for your test.Open Thresholds Step
Add a Threshold
- Metric: What to measure (p50, p90, p95, p99, avg, errorRate, throughput)
- Operator: Comparison (less than, greater than, equals)
- Value: Target value
- Severity: Error (fails test) or Warning (flags but passes)
Add More Thresholds
How to Select Test Location
Choose where load originates geographically.View Available Locations
Select a Location
Consider Proximity
During Test Execution
After clicking Launch Test:- Status Panel: Shows real-time test progress
- Live Metrics: Requests, latency, success rate update in real-time
- Logs: K6 execution output streams live
- Auto-Navigation: Redirects to detailed results when complete
Troubleshooting
Test fails to start
Test fails to start
- Verify the URL is valid and accessible from the internet
- Check that authentication credentials are correct
- Ensure the target server allows requests from proxy IPs
All requests fail
All requests fail
- Check the target URL is reachable
- Verify SSL certificates if using HTTPS
- Review request headers and body format
- Check for rate limiting or IP blocking on target server
Latency higher than expected
Latency higher than expected
- Consider the geographic distance between test location and server
- Check if your server is under load from other sources
- Review if authentication adds overhead
Cannot add steps in multi-step mode
Cannot add steps in multi-step mode
- Ensure you’ve switched to Multi-Step mode
- Each step requires at minimum a name and URL
Variable extraction not working
Variable extraction not working
- Verify the JSONPath expression is correct
- Ensure the previous step returns the expected response structure
- Check that variable names don’t contain special characters
FAQ
How many VUs can I use?
How many VUs can I use?
What's the difference between VUs and requests?
What's the difference between VUs and requests?
Can I test internal/private APIs?
Can I test internal/private APIs?
How are results stored?
How are results stored?
Can I schedule recurring tests?
Can I schedule recurring tests?
What happens if I close the browser during a test?
What happens if I close the browser during a test?