Skip to main content

Test Runner

The test runner allows you to automate API testing with assertions, variable extraction, and detailed reporting.

Overview

Opening the Test Runner

  1. Right-click on a collection in the sidebar
  2. Select Run Tests
  3. A new tab opens with the test runner

Test Configuration

Request Order

Requests run in the order they appear in the collection. Drag to reorder.

Run Options

OptionDescription
Stop on FailureStop execution when a test fails
Delay Between RequestsWait time between requests (ms)

Assertions

Each request can have multiple assertions to verify the response.

Assertion Types

TypeDescriptionExample
StatusCheck status codestatus == 200
Status RangeCheck status in rangestatus in 200-299
JSONPathCheck JSON value$.data.id == "123"
ContainsCheck body contains textbody contains "success"
Response TimeCheck response timetime < 500ms
HeaderCheck header valueheader Content-Type == application/json

Adding Assertions

  1. Click on a request in the test runner
  2. Go to Assertions section
  3. Click Add Assertion
  4. Configure:
    • Type
    • Expected value
    • Operator (for JSONPath)

JSONPath Examples

JSONPathDescription
$.data.idGet id from data object
$.users[0].nameFirst user's name
$.items[*].priceAll prices
$.meta.totalTotal from meta

Operators

OperatorDescription
equalsExact match
not_equalsNot equal
containsContains substring
existsValue exists
not_existsValue doesn't exist

Variable Extraction

Extract values from responses to use in subsequent requests.

Adding Extractions

  1. Go to Extract Variables section
  2. Click Add Extraction
  3. Configure:
    • Variable Name: Name to store as
    • JSONPath: Path to extract

Example Flow

Request 1: Create User

  • Extract: USER_ID from $.id

Request 2: Get User

  • URL: {{API_URL}}/users/{{USER_ID}}

Running Tests

Start Test Run

  1. Click Run All to execute all requests
  2. Or click Run on individual requests

Progress

During execution:

  • Current request is highlighted
  • Progress bar shows completion
  • Results update in real-time

Stopping

Click Stop to halt execution at any time.

Test Results

Summary

MetricDescription
TotalNumber of requests
PassedSuccessful tests
FailedFailed assertions
ErrorsRequest errors
TimeTotal execution time

Per-Request Results

Each request shows:

  • ✓ Passed / ✗ Failed status
  • Response status code
  • Response time
  • Assertion results
  • Extracted variables

Assertion Details

For each assertion:

  • Expected value
  • Actual value
  • Pass/Fail status

Test History

Previous test runs are saved:

  1. Go to History tab in test runner
  2. View past runs with timestamps
  3. Click to see detailed results

Example Test Suite

User API Tests

Request 1: Create User

POST {{API_URL}}/users
Body: {"name": "Test User", "email": "test@example.com"}

Assertions:
- Status == 201
- $.id exists
- $.name == "Test User"

Extract:
- USER_ID from $.id

Request 2: Get User

GET {{API_URL}}/users/{{USER_ID}}

Assertions:
- Status == 200
- $.id == "{{USER_ID}}"
- Response time < 500ms

Request 3: Update User

PUT {{API_URL}}/users/{{USER_ID}}
Body: {"name": "Updated User"}

Assertions:
- Status == 200
- $.name == "Updated User"

Request 4: Delete User

DELETE {{API_URL}}/users/{{USER_ID}}

Assertions:
- Status in 200-204

Best Practices

Independent Tests

Design tests that can run independently when possible.

Clean Up

Include cleanup requests (delete created resources) at the end.

Meaningful Assertions

Test business logic, not just status codes:

  • Verify response structure
  • Check calculated values
  • Validate relationships
Variable Extraction

Use extraction to chain requests and avoid hardcoded IDs.