User GuidesTesting REST API Endpoints

Testing REST API Endpoints

Learn how to create and run tests for your REST API endpoints using A²D’s testing framework.

Overview

REST APIs in A²D can be tested through:

  1. Playground — Interactive testing from the REST API detail page.
  2. A2TF Test Cases — Automated tests with expected conditions.
  3. Test Lab Suites — Group tests and run them in suites.
  4. Exploratory Testing — Invite external users to test endpoints.

Quick Start: Playground

  1. Open your REST API from the sidebar.
  2. Click the Playground tab.
  3. Click Refresh to load endpoints from the API definition.
  4. Expand an endpoint card, fill in parameters, and click Send.
  5. View the response status, headers, and body.

Creating Automated Tests

Step 1: Open Test Cases

Navigate to your REST API detail page and click the Test Cases tab.

Step 2: Create a Test Case

Click ”+ New Test” and configure:

  • Name — A descriptive name (e.g. “Get product by ID returns correct product”).
  • Scopes — Select which endpoints to test.
  • Input — Configure path parameters, query parameters, custom headers, and request body.

Step 3: Import from Mock Scenarios

Instead of creating tests from scratch, you can auto-generate them from mock scenarios:

  1. Click “Import from Scenarios”.
  2. Select which scenarios to import.
  3. Tests are created with inputs and expected conditions pre-filled.

Step 4: Define Expected Conditions

For each endpoint scope, configure validation rules:

Status Code: Set the expected HTTP status code (e.g. 200, 201, 404).

Field Conditions: Add conditions to validate the response body. Since REST API responses are auto-parsed as JSON, use direct field paths:

PathDescription
productIdTop-level field
data.items[0].nameNested field with array index
error.messageNested error field
items.0.idAlternative array notation (.0 instead of [0])

Available Operations

OperationDescriptionExample
eqEquals expected valueproductId (eq) "MULETEST0"
neqNot equalstatus (neq) "error"
existsField exists and is not nullproductId (exists)
containsString contains substringmessage (contains) "success"
isNumericValue is a numberquantity (isNumeric)
isTextValue is a non-empty stringname (isText)
isArrayValue is an arrayitems (isArray)
isObjectValue is an objectmetadata (isObject)
matchesRegexMatches regex patternemail (matchesRegex) "^[^@]+@[^@]+$"

Example: Validate Product Response

For a REST API endpoint POST /mmbe that returns:

{
  "productId": "MULETEST0",
  "availibleQuantity": 1650400
}

Configure these conditions:

  1. Status code: expected 200
  2. Path: productId, Op: exists
  3. Path: productId, Op: eq, Value: "MULETEST0"
  4. Path: availibleQuantity, Op: isNumeric

Running Tests

From the REST API Page

On the Test Cases tab, click Run on individual tests.

From Test Lab

  1. Go to Test Lab → Execution.
  2. Select a suite that includes REST API tests.
  3. Choose the environment.
  4. Click Run.

Viewing Results

Test results show:

  • Endpoint label — Displays as POST /mmbe (method + path) instead of a generic label.
  • Input — The HTTP request sent (URL, method, body).
  • Output — The response received (body, status code).
  • Validation — Each condition with its expected value, actual value, and pass/fail indicator.

If a condition fails, you can see exactly what was expected vs what was received:

productId (eq) expected: "MULETEST0", actual: "OTHER_VALUE" ✗

Exploratory Testing

Include REST APIs in exploratory testing sessions:

  1. Go to Test Lab → Exploratory.
  2. Create or open a session.
  3. Click the REST APIs tab.
  4. Add REST APIs with their environments.
  5. Invite testers — they’ll see endpoints as interactive cards.
  6. Review feedback in the Feedback tab.

Next Steps


Test your REST API endpoints with automated validations and hands-on exploratory testing.