$ show healenium/healenium-web
Healenium-web is a self-healing library for Selenium WebDriver-based tests. It wraps standard WebDriver instances in a SelfHealingDriver proxy that intercepts element lookup calls and attempts to heal failed locators by finding alternative strategies when elements aren't found. The architecture uses a chain of responsibility pattern with specialized processors for finding elements, retrieving reference data from a backend service, healing elements through various selector strategies, and saving results. The system communicates with a backend service (hlm-backend) to store and retrieve element metadata, enabling intelligent locator recovery across test runs.
The LLM identified 5 files worth highlighting for reuse:
Implements a clean strategy pattern for generating different CSS selector components (PATH, PARENT, TAG, etc.) from DOM nodes. Each component type has its own ElementCreator implementation, making it easy to extend with new selector strategies. This component is highly reusable in any DOM manipulation or web scraping context.
A set of focused classes (AttributesElementCreator, ClassElementCreator, IdElementCreator, etc.) each responsible for generating a specific part of a CSS selector from a DOM node. Demonstrates excellent separation of concerns and single responsibility principle. Each implementation can be reused independently in other projects needing to generate CSS selectors.
Provides utility methods to create JDK dynamic proxies for Selenium WebDriver, WebElement, and TargetLocator interfaces. Properly combines multiple interfaces in a single proxy and handles the invocation logic. This component could be reused in any project needing to create proxies for Selenium-based interfaces.
Contains utilities for analyzing stack traces, particularly for detecting annotations and filtering out framework noise from packages like java.base, sun.reflect, etc. The redundantPackages() method shows practical experience with common stack trace noise. Useful in any project needing clean stack trace analysis for logging or debugging.
Provides useful utility methods including getMd5Hash (with proper UTF-8 handling) and getHostProjectName. Self-contained and generally applicable utility functions that could be reused in many Java projects.