The intermittent nature and connection refused error indicate environment configuration issues combined with test execution patterns. Your automated tests are likely overwhelming the QA RPA infrastructure.
Robot Registration in QA: First, verify your robot registration is environment-aware. In the RPA module configuration, ensure you have separate robot profiles for QA with dedicated endpoints. Check that the robot service is actually running and accessible at the endpoint your tests are calling. Use a health check microflow before test execution:
// Health check before robot execution
GET /api/rpa/health
IF response.status != 200 THEN
WAIT 2000ms and RETRY
Environment-Specific Endpoint Config: Create environment constants in your Mendix app. Never hardcode endpoints. In your deployment pipeline, set these values:
In your robot trigger microflow, always reference the constant, not a literal string.
Automated Test Integration with RPA: The key issue is synchronization. Automated tests execute faster than manual triggers, creating race conditions. Implement this pattern in your test framework:
- Before test suite: Verify robot availability with health check
- In each test: Add explicit wait for robot ready state (poll status endpoint)
- After robot trigger: Poll for completion status instead of assuming immediate execution
- Implement retry logic with exponential backoff for transient failures
- Add test isolation - use unique task IDs to prevent cross-test interference
For the connection refused error specifically, check your QA firewall rules. Automated test runners might be executing from different network segments than manual test machines, causing connection blocks.
Also scale your QA RPA infrastructure. If you’re running parallel test suites, you need multiple robot instances. Configure a robot pool with at least 3-5 instances for QA to handle concurrent automated test execution. Use the RPA module’s queue management features to distribute tasks across available robots.
Finally, add comprehensive logging in your robot trigger microflows. Log the endpoint being called, robot ID, task parameters, and response codes. This will help identify whether failures are configuration issues, timing problems, or actual robot execution errors. The 60% failure rate should become 0% once you implement proper environment configuration, health checks, and queuing logic.