This repository contains automated test scripts for the OrangeHRM web application using Java, Selenium WebDriver, TestNG, and Maven. The project follows the Page Object Model (POM) with the Fluent Interface Pattern for clean and maintainable test code. It also integrates Allure Reports for test reporting and Java Faker for generating realistic test data.
- Java 24 for Programming language
- IntelliJ IDEA Community Edition for IDE
- Selenium WebDriver for Web automation
- TestNG for Test execution framework
- Maven for Build & dependency management
- Allure Reports for visual test reporting
- Java Faker for Random test data generation
- Page Object Model for Test design pattern so, All locators and actions are defined inside the respective page class.
- Fluent Interface Pattern for Improves readability of test steps
Before running the tests, ensure you have installed:
Check installation:
java -versionmvn -versionallure --version
git clone https://github.com/your-username/orangehrm-automation.gitcd orangehrm-automation
mvn clean install
option1:
mvn clean test
option2: run testng.xml file manually or use thie command:
mvn clean test -DsuiteXmlFile=testng.xml
After running the tests:
allure serve target/allure-results
- Navigate to the website
- Login using: ○ Username: Admin ○ Password: admin123
- Click on the Admin tab in the left-side menu
- Capture the number of records found
- Click on Add button and fill in required user data
- Click on Save
- Verify that the number of records increased by 1
- Search by the newly created username
- Delete the user
- Verify that the number of records decreased by 1
│
├── 📜 pom.xml
├── 📜 testng.xml # TestNG suite configuration
│
├── 📂 src
│ ├── 📂 main
│ │ └── 📂 java
│ │ └── 📂 utils
│ │ ├── ConfigReader.java # Reads config.properties
│ │ ├── DriverFactory.java # WebDriver setup
│ │ └── Utility.java # Faker-based random data
└── 📂 pages # Page Object Model classes
│ │ ├── AddUserPage.java # adduser page locators & actions
│ │ ├── LoginPage.java # Login page locators & actions
│ │ ├── DashboardPage.java # Dashboard page locators & actions
│ │ ├── AdminPage.java # Add/Search/Delete Employee actions
│ │ └── ...
│ │
│ │
│ └── 📂 test
│ └── 📂 java
│ ├── 📂 tests # Test classes
│ │ ├── BaseTest.java # Common setup/teardown for tests
│ │ ├── fullScenarioTest.java
│ │
│ └── 📂 listeners # TestNG Listeners
│ └── MethodListener.java
│ └── TestListener.java
│ └── 📂 resources
📂 TestData
│ └── environment.properties
│ └── validLogin.json #data
├── 📂 target # Maven output folder (auto-generated)
│ ├── 📂 allure-results # Allure results (after running tests)
│ ├── 📂 surefire-reports # TestNG HTML reports
│ └── ...
│
- Java Faker is used for generating dynamic data
