A comprehensive Java-based automation testing framework using Maven, Selenium WebDriver, TestNG, and advanced reporting capabilities.
- Page Object Model (POM) design pattern
- Cross-browser testing support (Chrome, Firefox, Edge)
- Parallel test execution with TestNG
- Data-driven testing with Excel/CSV support
- Comprehensive reporting with ExtentReports and Allure
- Screenshot capture on test failures
- Configuration management with properties files
- Logging with Log4j2
- CI/CD ready with Maven
| Technology | Version | Purpose |
|---|---|---|
| Java | 11+ | Programming Language |
| Maven | 3.6+ | Build Tool |
| Selenium WebDriver | 4.15.0 | Web Automation |
| TestNG | 7.8.0 | Test Framework |
| ExtentReports | 5.1.1 | HTML Reporting |
| Allure | 2.24.0 | Advanced Reporting |
| WebDriverManager | 5.6.2 | Driver Management |
| Log4j2 | 2.20.0 | Logging |
| Apache POI | 5.2.4 | Excel Data Handling |
bharattesting123/
βββ src/
β βββ main/java/com/automation/framework/
β β βββ config/
β β β βββ ConfigManager.java # Configuration management
β β βββ driver/
β β β βββ DriverFactory.java # WebDriver factory
β β βββ pages/
β β β βββ BasePage.java # Base page class
β β β βββ GoogleMapsPage.java # Google Maps page object
β β βββ utils/
β β βββ ExtentReportManager.java # ExtentReports manager
β β βββ ScreenshotUtils.java # Screenshot utilities
β β βββ TestListener.java # TestNG listener
β β βββ ExcelDataProvider.java # Excel data provider
β βββ test/
β βββ java/com/automation/tests/
β β βββ base/
β β β βββ BaseTest.java # Base test class
β β βββ GoogleMapsTests.java # Google Maps test cases
β βββ resources/
β βββ config.properties # Configuration properties
β βββ log4j2.xml # Logging configuration
β βββ testng.xml # TestNG suite configuration
β βββ testdata.csv # Test data
βββ reports/ # Generated reports
βββ screenshots/ # Test screenshots
βββ logs/ # Application logs
βββ pom.xml # Maven configuration
βββ *.bat # Execution scripts
- Java 11+ installed
- Maven 3.6+ installed
- Chrome/Firefox browser installed
- Git (optional, for version control)
- Clone or download the project
- Navigate to the project directory
- Install dependencies:
mvn clean install
- All Tests: Double-click
run-all-tests.bat - Smoke Tests: Double-click
run-smoke-tests.bat - Regression Tests: Double-click
run-regression-tests.bat - Generate Allure Report: Double-click
generate-allure-report.bat
# Run all tests
mvn clean test
# Run specific test groups
mvn clean test -Dgroups=smoke
mvn clean test -Dgroups=regression
# Run with specific browser
mvn clean test -Dbrowser=firefox
# Run specific test class
mvn clean test -Dtest=GoogleMapsTests
# Run specific test method
mvn clean test -Dtest=GoogleMapsTests#testGoogleMapsPageLoadmvn clean test -Dsuite=src/test/resources/testng.xml- Location:
reports/extent-report.html - Features: Test results, screenshots, execution time
- Auto-opens: After test execution
- Generate: Run
generate-allure-report.bat - Features: Advanced analytics, trends, history
- Command:
mvn allure:serve
- Location:
test-output/index.html - Features: Basic test results and suite information
# Browser settings
browser.default=chrome
browser.headless=false
browser.window.maximize=true
browser.implicit.wait=10# Test data settings
test.data.file=testdata.csv
test.data.sheet=TestData# Report settings
report.extent.title=Automation Test Report
report.screenshots.on.failure=true| Test Case | Description | Priority |
|---|---|---|
testGoogleMapsPageLoad |
Verify Google Maps page loads | Critical |
testLocationSearch |
Test location search functionality | Normal |
testRoutePlanning |
Test route planning between locations | Normal |
testMapNavigation |
Test map navigation features | Minor |
testInvalidLocationSearch |
Test error handling | Minor |
- Separation of test logic and page elements
- Reusable page components
- Easy maintenance
- Automatic driver download and setup
- Support for multiple browsers
- ThreadLocal driver instances for parallel execution
- Centralized configuration
- Environment-specific settings
- Runtime parameter override
- Multiple report formats
- Screenshot attachment
- Test execution metrics
- Excel/CSV data support
- Parameterized test execution
- Test data management
Modify testng.xml for parallel execution:
<suite name="ParallelSuite" parallel="methods" thread-count="3">Override default properties:
mvn test -Dbrowser=firefox -Dheadless=trueCreate environment-specific property files:
config-dev.propertiesconfig-test.propertiesconfig-prod.properties
public class NewPage extends BasePage {
// Page elements and methods
}public class NewTests extends BaseTest {
@Test
public void testNewFeature() {
// Test implementation
}
}Add new test class to testng.xml:
<class name="com.automation.tests.NewTests"/>- Driver Issues: Ensure WebDriverManager is properly configured
- Browser Compatibility: Update browser versions
- Timeout Issues: Adjust wait times in configuration
- Report Generation: Check file permissions for report directories
Enable debug logging in log4j2.xml:
<Root level="DEBUG">For issues or questions:
- Check the logs in the
logs/directory - Review the generated reports
- Ensure all prerequisites are met
- Verify configuration settings
- Follow the existing code structure
- Add appropriate JavaDoc comments
- Include unit tests for new features
- Update documentation
This project is for educational and testing purposes.
Happy Testing! π