Support & information center

Webhooks in testRTC

testRTC enables the use of webhooks to catch a rich set of events within the system. These can be used for testing as well as monitoring. These are most often used for things like;

  • Notifications
  • Run results
  • Custom alerts

URL only

If you place in the webhook the URL only, we will be sending it out as a JSON object.


JSON object

The webhook configuration below sends the information as a JSON object in the body of the message.

   "format": "json/object",
   "url": "https://dummy.url"

JSON text format

If you are planning to integrate the webhook with something like Slack or Zapier, then the best approach is to use a JSON text format, where we “stringify” the information.

   "format": "json/text",
   "url": "https://dummy.url"

You can read more on sending test results via webhook to Slack.


Here is how to send our webhooks as CloudEvents v1.0 format:

   "format": "cloudevent",
   "url": "https://dummy.url"

The above will send the webook to “url” formatting the body of the message as CloudEvents format.

Amazon SNS

If you plan on sending the webhook to Amazon Simple Notification Service, then you can use the following format:

    "provider": "aws-sns",

    "secretAccessKey": "xxx",
    "region": "xxx",
    "accessKeyId": "xxx",

    "roleArn": "xxx",
    "topicArn": "xxx",

    "body": {
      "Server": "TestRTC",
      "Instance": "<%this.runName%>",
      "Severity": "TestRTC",
      "Message": `testRTC Alert for <%this.testName%> 
      failure:<% this.failureScreenshot %>`,

Custom body templating (limited application)

Note: Custom body templating is not available for all products. It can only be used with testingRTC and upRTC

For testingRTC and upRTC, you can also format our webhook as you see fit using our body templating format. Below is an example for it.

    "url": "",
    "body": {
      "testRunId": "<%this.testRunId%>",
      "testName": "<%this.testName%>",      
      "userName": "<%this.userName%>",      
      "projectName": "<%this.projectName%>",
      "projectId": "<%this.projectId%>",      
      "status": "<%this.status%>",
      "concurrentUsers": "<%this.concurrentUsers%>",
      "numberOfProbesSuccess": "<%this.numberOfProbesSuccess%>",
      "numberOfProbesWarning": "<%this.numberOfProbesWarning%>",
      "numberOfProbesFailure": "<%this.numberOfProbesFailure%>",
      "totalTestTimeMin": "<%this.totalTestTimeMin%>",
      "score": "<%this.score%>",
      "runName": "<%this.runName%>",
      "runType": "<%this.runType%>",
      "error": "<%this.error%>",
      "additionalInfo": "<%this.additionalInfo%>",     
      "failureReasons": "<%this.failureReasons%>",
      "failureScreenshot": "<%this.failureScreenshot%>",
      "resultUrl": "<%this.resultUrl%>"

Custom variables

You can pass certain variables to the webhook in its advanced format. This is useful for collecting information and when you want to format the message itself.

testRunIdIdentifier of the specific test execution
testNameThe name of the test script
projectNameThe name of the testRTC project running this test
runNameThe random name allocated for the specific test execution
runTypeThe type of execution. Will be either test or monitor
statusThe status of the test execution (essentially, if it succeeded or failed)
errorAssociated error message in case the test failed
additionalInfoThe information provided via rtcSetAdditionalInfo()
failureReasonsTextual reason for failure
failureScreenshotURL to the screenshot taken on failure, if such exist
scoreMedia score for the test execution
resultUrlURL to the test result for easy access
concurrentUsersTotal number of probes in the test execution
numberOfProbesSuccessNumber of probes in the test execution with a successful result status
numberOfProbesWarningNumber of probes in the test execution with a warning result status
numberOfProbesFailureNumber of probes in the test execution with a failure result status
totalTestTimeMinFull length of the test execution in minutes
userNameThe name of the user who executed the test

Note: You can integrate these variables anywhere in the body section of your webhook by placing them in <% %>

For example:


Was this article helpful?

Related Articles