Sending test result notifications to Slack via Scheduler
Sending test result notifications to Slack via Scheduler
Leapwork can send test result notifications to Slack using their Webhooks/API. Webhooks are a type of event-driven API that lets you push and pull information between different types of apps.
Below is the step-by-step process to create Webhook in Slack and use it in Leapwork Schedule:
Steps to create Webhook in Slack:
- Open the following URL: https://slack.com/signin?redir=%2Fservices%2Fnew%2Fincoming-webhook
- Sign in to your Slack workspace
- Enter your credentials
- On the incoming WebHooks page select the channel to post the message.
- Click Add 'Incoming WebHooks integration' button
- On the next page go to the Integration settings section, Copy the URL, and if required change the Name and Image of the sender WebHook, and press Save afterward.
Using Slack WebHook in Leapwork:
Now that you have a URL for your Webhook, you can use it on Scheduler Action "Send HTTP(S) request" as shown below.
- Edit or Create a New Schedule
- Go To the 'Actions' tab
- Condition: Choose as per the requirement
- Action: Send HTTP(S) request
- Method: POST
- URL: Paste the above-copied URL in the textbox.
- Header: Content-Type: application/json
- Post Variable: {"text": "Test Status: Case Passed: Token, Cases failed: Token."}
Note: Tokens can be replaced by Leapwork Tokens by Right Click and Insert Token.
- Save and Run your test.
Post-test run is completed Leapwork will automatically call the Webhook and post a message in Slack, an example message is shown below.
For any clarification, please contact our Priority Support.