Fix My Test
When tests fail, Maeris provides powerful tools and features to help you quickly identify and fix issues. This guide covers common problems and how to resolve them effectively.
Understanding Test Failures
The first step in fixing a test is understanding why it failed. Maeris provides detailed error messages, screenshots, and logs to help you diagnose issues.
Where to Find Failure Information
- Test Information Modal: View detailed results for the failed test
- Error Messages: Read the specific error message for the failing step
- Screenshots: Visual evidence showing what happened at the point of failure
- Execution Logs: Detailed logs showing each action and its outcome
- Console Logs: Browser console messages and JavaScript errors
Common Issues and Solutions
Element Not Found
Problem: Maeris cannot locate the element specified by your selector.
Solutions:
- Verify the selector is correct using browser DevTools
- Check if the element exists on the page (may have been removed or changed)
- Add a wait step before interacting with the element
- Update the selector if the element's attributes have changed
- Use the Light QA Extension to fetch the current selector
- Enable auto-healing to automatically adapt to element changes
Timeout Waiting for Element
Problem: The element didn't appear within the specified timeout period.
Solutions:
- Increase the timeout value in test configuration
- Add an explicit wait step before the interaction
- Check if the page is loading slowly or there's a network issue
- Verify the element appears conditionally (may need different approach)
- Check for JavaScript errors preventing element rendering
Verification Failed
Problem: An assertion or verification step failed because the expected condition wasn't met.
Solutions:
- Review the screenshot to see the actual state
- Verify the expected value is correct
- Check if the application behavior has changed
- Use more flexible verification methods (contains vs. exact match)
- Add debugging steps to understand the current state
Application Error
Problem: The application encountered an error during test execution.
Solutions:
- Check application logs for errors
- Verify the application is running and accessible
- Check for environment-specific issues
- Review recent application changes that might have caused the error
- Test manually to reproduce the issue
Debugging Tools and Techniques
Using Screenshots
- Screenshots show the exact state of the page at the point of failure
- Compare screenshots from failed and successful runs
- Use screenshots to verify element visibility and page state
- Share screenshots with developers when reporting bugs
Reviewing Logs
- Execution logs show each step and its outcome
- Console logs reveal JavaScript errors and warnings
- Network logs show API calls and responses
- Look for patterns or errors that occurred before the failure
Step-by-Step Debugging
- Run the test step by step to isolate the failing step
- Add additional verification steps to understand state
- Test individual steps manually in the browser
- Use browser DevTools to inspect elements and network activity
Leveraging Auto-Healing
Maeris's auto-healing feature can automatically adapt to changes in your application, reducing the need for manual fixes.
How Auto-Healing Works
- When an element isn't found, Maeris tries alternative selectors
- Automatically adjusts for minor UI changes
- Learns from successful executions to improve future runs
- Reduces maintenance overhead for stable tests
Enabling Auto-Healing
- Enable in Advanced Settings for individual tests or globally
- Configure auto-healing strategies and preferences
- Monitor auto-healing success rates in reports
Preventive Measures
Best Practices to Avoid Failures
- Use Stable Selectors: Prefer IDs and data attributes over class names
Class names often change with styling updates
- Add Appropriate Waits: Wait for elements to be ready before interaction
Prevents timing-related failures
- Test Regularly: Run tests frequently to catch issues early
Early detection makes fixes easier
- Keep Tests Updated: Update tests when application changes
Proactive maintenance prevents failures
- Use Data-Driven Testing: Test with various data sets
Identifies edge cases and data-related issues
Getting Additional Help
If you're unable to resolve a test failure:
- Review the detailed error messages and logs
- Check the Maeris documentation for specific error types
- Search for similar issues in the community or support resources
- Contact Maeris support with test details and error information
- Share test configuration and logs with your team for collaborative debugging
Next Steps
After fixing your tests, continue improving your test suite:
- Advanced Settings - Configure auto-healing and other features
- Verification Library - Learn about verification options
- Reporting and Dashboard - Monitor test health and trends