📊 Create a Monitor
Monitoring in E2E Test Automation is a powerful feature that allows users to automate the execution of API Collections on a defined schedule. This ensures continuous testing of your APIs for availability, correctness, and performance. With monitors in place, you can detect issues early, ensuring your APIs remain functional and responsive, especially in production environments.
🔄 How API Collections and Monitors Work Together
A monitor in E2E Test Automation is always based on an existing API Collection. Here’s how they work together:
- API Collections define the API requests you want to test, along with any test scripts you have written
- When a monitor runs, E2E Test Automation executes the requests from the selected collection
- The environment associated with the monitor injects any variables such as
base_url,access_token, and other dynamic values - The monitor also runs pre-request and post-response scripts exactly as they would in manual testing, ensuring consistency across automated and manual runs
This integration allows you to reuse your test scripts and ensures that your monitoring reflects the same logic as your manual tests.
🛠️ Creating a Monitor
Creating a monitor in E2E Test Automation is easy and follows a few straightforward steps. Let’s go through the process:
Step 1: Navigate to Monitoring
Steps:
- From the E2E Test Automation sidebar, go to API Testing Lab
- Select Monitoring
This will bring you to the Monitor Dashboard, where you can view and manage all your monitors.
Step 2: Click “Create Monitor”
Click on the “Create Monitor” button to open the Monitor Configuration Wizard. This is where you will define all the monitor settings.
Step 3: Monitor Setup
In the wizard, you’ll need to fill in the following fields:
Step 4: Configure Scheduling
Scheduling defines when and how often the monitor should run.
Why Scheduling Matters:
- It ensures 24/7 health checks for your APIs
- It allows monitoring after deployments or during peak hours
- It helps detect time-sensitive failures, such as expired tokens or timeouts
Step 5: Configure Retry on Failure
Sometimes API failures are temporary due to network issues, server errors, or other transient conditions. Retrying a failed monitor run can help avoid false alarms.
What Retries Cover:
- Temporary network issues
- Transient server errors (e.g., 502, 503)
- Authentication token delays or missed heartbeats
Example Benefit:
If a monitor runs at 10:00 AM and gets a 502 Bad Gateway error, E2E Test Automation will wait 30 seconds and retry. If the second attempt is successful, no failure alert will be triggered.
Step 6: Set Notifications and Alerts
You can configure notifications so that you are alerted whenever a monitor fails.
This ensures your team is always informed and can take action before users experience issues.
🎯 Why Monitoring is Important
Monitoring your APIs regularly offers several key benefits:
- Catches issues early – before they impact users
- Saves time – automates routine testing and avoids manual checks
- Ensures reliability – APIs are continuously monitored to ensure they perform as expected
- Boosts confidence – your team can trust that the APIs are functioning properly and be alerted if something goes wrong
✅ Summary
Creating and managing monitors in E2E Test Automation is an effective way to automate API testing, ensuring continuous health checks and immediate alerts when things go wrong. By scheduling regular tests, leveraging retry logic, and setting up notifications, you can keep your APIs functioning smoothly and address issues before they affect your users.
Happy monitoring! 🚀