apic docs
  • About APIC
  • Installing APIC
  • Getting started with APIC
  • Designer
    • Getting Started With APIC designer
    • Working with API project
    • Creating a Folder
    • Creating a Model or Definitions
    • Creating a Trait
    • Creating an Endpoint
    • Write API Tests starting from Design Phase
    • API Security Definitions
    • Export and view Docs
  • Tester
    • Make an API call
    • Sending Forbidden request headers with APIC
    • Viewing API Response
    • Managing Environments
    • Using Environments
    • Using the Test Builder
    • Writing Test Cases
    • Response Schema validation
    • Creating Test Suites
    • Test Websocket
  • Test Real User Sessions
  • APIC Command line interface (apic-cli)
  • APIC Web Agent (apic-cli)
  • APIC CI/CD Integration (with Jenkins)
  • API Documentation
  • Simulator
  • Dashboard
    • Team Management
    • Published Docs
  • Sharing
Powered by GitBook
On this page

Was this helpful?

  1. Tester

Using the Test Builder

PreviousUsing EnvironmentsNextWriting Test Cases

Last updated 5 years ago

Was this helpful?

APIC comes with a powerful test builder that lets you build tests from your response.

The Test Builder is available in the response section of the . To use it make an API call using the API Runner. The response section will scroll into view. Under the Body/Test builder tab select the Build API Tests button present on the top right corner. This would open the Test Builder with your JSON response. Click on any of the keys to continue.

On the selected field in response, you can add a following types of assertions from this screen:

  • Equals

    • To a specific value.

    • To a field in the request body.

    • To a field in request header.

    • To a value stored in an environment variable.

  • Exists

    • Assertion to check if a field should/should not exist in response.

  • Is/Type

    • Assertion to check the type of the value, ie String, Number, Boolean, Array or Object.

  • Constains

    • Assertion to check if the response value contains/doesn't contain a specofic phrase.

  • In

    • Assertion to ckeck if the values in the response in from a specifed list or not.

  • Greater/Lesser

    • Assertion to check if the response value is greater/lesser than (or equals) to a specified value or not

  • Environment

    • Adds script to save current value in environment with a specifed name.

API Runner