A comprehensive test automation framework with AI agent integration, designed for intelligent test execution and analysis.
- Modern Java 24 with Maven build system
- Selenium 4.35.0 for web automation
- TestNG for test execution and reporting
- Page Object Model for maintainable test structure
- ExtentReports for comprehensive reporting
- Multi-Provider Support: OpenAI GPT-4 and Anthropic Claude
- Intelligent Element Analysis: AI-powered web element analysis
- Smart Test Generation: Automated test step and data generation
- Natural Language Element Finding: Find elements using descriptions
- AI-Powered Reporting: Enhanced test insights and analysis
- Cross-Browser Support: Chrome, Firefox, Edge, Safari
- Screenshot Management: Automatic screenshots on pass/fail
- Configuration Management: Flexible property-based configuration
- Test Listeners: Enhanced reporting with AI analysis
- Utility Classes: Comprehensive helper methods
src/
βββ main/java/com/automation/
β βββ ai/ # AI Agent Integration
β β βββ AgentManager.java # Main AI coordinator
β β βββ ElementAnalyzer.java # AI element analysis
β β βββ TestGenerator.java # AI test generation
β β βββ ElementAnalysis.java # Analysis data model
β β βββ providers/ # AI Provider implementations
β β βββ AIProvider.java # Provider interface
β β βββ OpenAIProvider.java # OpenAI integration
β β βββ AnthropicProvider.java # Anthropic integration
β βββ base/ # Base Classes
β β βββ BaseTest.java # Base test class
β βββ config/ # Configuration
β β βββ ConfigManager.java # Configuration management
β βββ constants/ # Constants
β β βββ TestConstants.java # Test constants
β βββ enums/ # Enumerations
β β βββ BrowserType.java # Browser types
β βββ listeners/ # Test Listeners
β β βββ AITestListener.java # AI-enhanced listener
β βββ pages/ # Page Objects
β β βββ BasePage.java # Base page class
β β βββ LoginPage.java # Login page object
β β βββ HomePage.java # Home page object
β βββ utils/ # Utilities
β βββ WebDriverFactory.java # Driver factory
β βββ ScreenshotUtils.java # Screenshot utilities
β βββ ReportManager.java # Report management
βββ test/java/com/automation/tests/ # Test Classes
βββ LoginTest.java # Login tests
βββ AIAgentTest.java # AI agent tests
βββ ComprehensiveAITest.java # Comprehensive AI tests
- Java 24 or higher
- Maven 3.6+
- Chrome/Firefox/Edge browser
- AI API key (OpenAI or Anthropic)
- Update
config.properties:
# AI Agent Configuration
ai.enabled=true
ai.provider=openai
ai.api.key=your_actual_api_key_here
ai.model=gpt-4
ai.timeout=30- Configure Browser:
browser=chrome
headless=falseThe framework includes all necessary dependencies in pom.xml:
- Selenium WebDriver
- WebDriverManager
- TestNG
- ExtentReports
- Apache Commons IO
- Jackson for JSON processing
mvn testmvn test -DsuiteXmlFile=testng.xmlmvn test -Dtest=LoginTest// Find element using natural language
WebElement element = getAgentManager().findElementByDescription("username input field");// Analyze element with AI insights
ElementAnalysis analysis = getAgentManager().analyzeElement(element);
System.out.println("AI Analysis: " + analysis.getDescription());// Generate test steps using AI
String testSteps = getAgentManager().generateTestSteps("Complete login flow");// Generate test data using AI
String testData = getAgentManager().generateTestData("username", "valid credentials");// Get AI analysis of test results
String analysis = getAgentManager().analyzeTestResults("Test completed successfully");The framework generates comprehensive reports with:
- AI Analysis: Intelligent insights on test execution
- Screenshots: Automatic capture on pass/fail
- Test Steps: Detailed step-by-step execution
- Performance Metrics: Execution times and analysis
- AI Recommendations: Suggestions for test improvement
Reports are generated in ./reports/extent-reports/ directory.
- Implement
AIProviderinterface - Add provider configuration
- Update
AgentManagerto support new provider
- Extend
BasePageclass - Use
@FindByannotations for elements - Implement page-specific methods
- Extend
BaseTestclass - Use AI agent capabilities
- Implement comprehensive reporting
- Visual Testing: AI-powered visual regression testing
- API Testing: AI-enhanced API test generation
- Performance Testing: AI-driven performance analysis
- Mobile Testing: AI-powered mobile automation
- Cross-Platform: Support for multiple platforms
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Implement your changes
- Add tests for new functionality
- Submit a pull request
For questions and support, please open an issue in the repository.