This project provides a cross-browser UI automation framework targeting https://demo.automationtesting.in/ using Selenium WebDriver, TestNG, and Allure reporting. It is designed for maintainable, parallelizable, and configurable browser testing.
- Cross-browser: Supports Chrome, Firefox, and Edge (local or Selenium Grid)
- Configurable: All settings via Maven/system properties,
.env, or hardcoded defaults - Parallel execution: Thread-safe WebDriver management for parallel test runs
- Page Object Model: Pages and selectors organized for maintainability
- Allure reporting: Automatic screenshots and page source on failure/skip
- Logging: Log4j2 for detailed execution logs
Requirements:
- Java 25 or newer (JDK 25 required)
- Maven 3.6 or newer
- Allure CLI (for report viewing)
Install Steps:
- Install Java 25 (Adoptium JDK 25 or via Homebrew:
brew install openjdk@25) - Install Maven (Download or via Homebrew:
brew install maven) - (Optional) Install Allure CLI (Docs, Homebrew:
brew install allure) - Clone this repo and run
mvn clean installto download dependencies and verify setup.
UI automation for https://demo.automationtesting.in/ using Selenium WebDriver, TestNG, and Allure. Follows Page Object Model (POM) and supports cross-browser, parallel, and environment-driven testing.
- Run all tests in Chrome:
mvn test - Run in Firefox/headless:
mvn test -Dbrowser=firefox -Dheadless=true - Generate Allure report:
allure serve target/allure-results
at_2503/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── core/ # Driver, config, base classes
│ │ │ ├── pages/ # Page objects (extend BasePage)
│ │ │ └── utils/ # Utilities
│ │ └── resources/
│ │ ├── TestData.json # Test data
│ │ └── log4j2.xml # Logging config
│ └── test/
│ └── java/
│ ├── BaseTest.java # Base test class
│ └── ... # Test classes (extend BaseTest)
├── testng-executer/ # TestNG suite XMLs
├── .github/ # Automation/AI agent instructions
├── pom.xml # Maven build file
├── README.md # Project documentation
└── ...
src/main/java/pages/- Page objectssrc/main/java/core/- Driver, config, base classessrc/main/resources/TestData.json- Test datatestng-executer/- TestNG suite XMLs
- Override via system properties,
.env, orTestData.json - See
core/TestSettings.javafor all options
- Log4j2, logs to
target/logs/
- Use
testng-executer/testng_parallel.xmlfor multi-threaded runs
All TestNG suite XMLs are in testng-executer/. You can run any suite using the -DsuiteXmlFile property:
- Single-threaded suite:
mvn test -DsuiteXmlFile=testng-executer/testng_single.xml
- Parallel suite:
mvn test -DsuiteXmlFile=testng-executer/testng_parallel.xml
If -DsuiteXmlFile is not specified, the default suite is used.
Examples:
# Run single-threaded suite (default browser)
mvn test -DsuiteXmlFile=testng-executer/testng_single.xml
# Run parallel suite (2 threads, default browser)
## Developer Notes
# Run parallel suite in Firefox, headless
mvn test -DsuiteXmlFile=testng-executer/testng_parallel.xml -Dbrowser=firefox -Dheadless=true
- Test classes must extend
BaseTest(handles driver setup/teardown, Allure hooks) - Page objects must extend
BasePageand use inner static selector classes for locators (seeLoginPage.LoginPageSelector) - Test data is accessed via
TestSettings.getTestData(key)and supports environment overrides - Configuration is managed in
core/TestSettings.javaand can be overridden via system properties,.env, orTestData.json - WebDriverManager is used for all browser driver management (no manual setup)
- Allure attachments (screenshots, page source) are included on test failure/skip automatically
- Create a new Page Object (if needed):
- Add a new class in
src/main/java/pages/extendingBasePage. - Define selectors as inner static classes (see
LoginPage.javafor example).
- Add a new class in
- Add or update test data:
- Edit
src/main/resources/TestData.jsonand add new keys/values as needed.
- Edit
- Create a new Test Class:
- Add a new class in
src/test/java/extendingBaseTest. - Use Allure annotations for reporting.
- Reference your page object and test data via
TestSettings.getTestData(key).
- Add a new class in
- Add to TestNG suite (if needed):
- Edit the appropriate XML in
testng-executer/to include your new test class.
- Edit the appropriate XML in
- Run and verify:
- Use the Quick Start/TestNG Suite Execution commands above.
- Check logs in
target/logs/and Allure reports for results.
See AlertTest.java and LoginTest.java for working examples.
- See
.github/copilot-instructions.mdand.github/agents/AI_AGENT.mdfor AI agent/project automation standards
- WebDriverManager is used for driver binaries (no manual setup)
- Allure attachments (screenshot, page source) on test failure/skip
- Logging via Log4j2; logs in
target/logs/ - Parallel execution via TestNG suite (
testng_parallel.xml) - Extend
BaseTestfor new tests; useBasePagefor page objects
See src/test/java/AlertTest.java for a sample alert handling test.
Minh Pham
For questions, support, or contributions, contact: mxstudios.dn@gmail.com