PagerDuty and Webhook Connectors
Our Connector feature enables you to track your Sauce Labs API Testing results in third-party apps outside of our platform. It seamlessly integrates API Testing into your day-to-day operations without disrupting workflows. Data is sent as an HTTP POST request containing a JSON payload.
Stay organized and facilitate monitoring by adding tags and clear naming conventions to your API Tests and Projects.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license).
- A PagerDuty account (for the PagerDuty connector only).
- An existing API Testing Project. For details on how to create one, see API Testing Quickstart.
PagerDuty Connector Setup
The PagerDuty Connector will trigger an incident in PagerDuty upon failure and then resolve that incident when the next automation execution succeeds.
- Notifies on-call responders based on failures in your API tests.
- Sends critical information on test failures as well as a link to the test report.
- Creates high and low urgency incidents based on the severity of the failure via dynamic tags in the test.
To set up this feature:
- Log in to Sauce Labs > click API Testing.
- Click on any Project.
- Within that Project, go to Settings > Connectors > Create Connector.
- Under the Template dropdown, select PagerDuty.
- In the Template section, you'll need to replace the
“routing_key"
value with your PagerDuty Integration Key, which you can find in PagerDuty by creating an App in Developer Mode. Optionally, you can also edit the other template values meet your needs.
- URL field is pre-populated with the PagerDuty URL (no action required).
- Content-Type field will pre-populate with application/json (no action required).
- Headers Key/Value pair fields are optional.
- On_success
- Turn the toggle to True if you'd like to receive data on all events, including successes, which can be handy when the service needs to log everything or alter a state.
- Turn the toggle to False to receive notifications for test failures only. This is typical for stateless services such as Slack.
Webhook Connector Setup
We also offer Webhook integrations to export data between Sauce Labs API Testing and third-party apps.
Like the PagerDuty Connector, setting up an outgoing webbook connector allows Sauce Labs API Testing to send test result data to external sources. To enable:
- Find the webhook URL for the third-party app you'd like to integrate.
- Log in to Sauce Labs > click API Testing.
- Click on any Project.
- Within that Project, go to Settings > Connectors > Create Connector.
- Under the Template dropdown, select WebHook.
- In the URL field, you'll need to enter the webhook URL for the third-party app you want to integrate.
- Content-Type field will pre-populate with application/json (no action required).
- Headers Key/Value pair fields are optional.
- Template section is pre-populated with the JSON payload indicating what data will be sent from API Testing to the third-party app. Optionally, you can also edit the other template values meet your needs.
- On_success
- Turn the toggle to True if you'd like to receive data on all events, including successes, which can be handy when the service needs to log everything or alter a state.
- Turn the toggle to False to receive notifications for test failures only. This is typical for stateless services such as Slack.
Testing Connectors
The Test Connectors feature tests the functionality of all connectors you have set up (as defined in their settings), but will not display any notifications on the dashboard. Testing a connector before executing it can minimize the time you spend creating connectors.
To test a connector:
- Log in to Sauce Labs > click API Testing.
- Click on any project.
- Within that project, click Settings and then click Connectors.
- On the Connectors page, click Test Connectors.
- In the Connectors Test Drive window, select either the Failure or Success radio button, and then click Trigger.
- Failure - You will receive a notification in all connector platforms in your list
- Success - If the On_success toggle is set to True, you will receive a notification for the connector
To check the functionality of connectors like PagerDuty that trigger an incident upon failure, and then resolve that incident with the following success, you need to first test for Failure and then for Success.