Skip to content

Asserting with HTTP/JSON API Endpoints

Botium can be instructed to call a HTTP/JSON API and assert the response within a conversation.


One use case is to verify content of shopping basket within the conversation flow test of an e-commerce chatbot.

The ref code for this asserter in Botium Box is by default HTTP

Assertion Modes

The asserter takes multiple parameters.

  • 1st parameter is the URL to call (HTTP GET)
  • (optional) 2nd parameter is the expected output.
    • If not given, verification is done on the HTTP response code only (2xx)
    • Otherwise the response returned from the URL call is compared to this
  • (optional) 3rd parameter is a JSONPath Expression to apply
    • If not given, the whole response content is used for assertion


If scripting memory is enabled the scripting variables can be used to dynamically build up those parameters.

Asserting for HTTP response code


Asserting for full HTTP response

HTTP | { "orderNumber": 1234533, "status": "OK" }

Asserting for parts of the HTTP response

HTTP | 1234533 | $.orderNumber
HTTP | OK | $.status

Asserting for plain text HTTP response


Base URI

The base URI for all the HTTP calls can be given in the global args for the asserter.

  "botium": {
    "Capabilities": {
      "ASSERTERS": [
          "ref": "HTTP",
          "src": "botium-asserter-http",
          "args": {
            "baseUri": ""

The baseUri is prepended to all HTTP calls (if they are not absolute Urls):

HTTP /fe8362a8-c50f-4dc3-af53-b936d81b8a0a | OK


This is useful for having several environment-specific configurations for this asserter, each one pointing to another server, for example:

In Botium Box, you have to register the HTTP Asserter multiple times and add them as Registered Component to the Test Projects for each environment.