End-to-end UI automation for the OrangeHRM demo site using Selenium WebDriver, Cucumber (Gherkin), TestNG, and Maven.
- Login with Admin credentials
- Navigate to Admin β User Management
- Add new users (role, employee autocomplete, status, username & password)
- Search by username
- Delete users (per-row trash action, confirmed by success toast)
- Robust waits:
- Toasts like βSuccessfully Saved/Deletedβ instead of brittle labels
- Table rows or βNo Records Foundβ instead of static counts
- Java (JDK 17+ / tested with JDK 23)
- Maven
- Selenium 4.25.0 + WebDriverManager
- Cucumber JVM 7.x + TestNG
- Chrome / Chromedriver
src
βββ main
β βββ java
β βββ pages
β βββ LoginPage.java
β βββ AdminPage.java
β βββ AddUserPage.java
βββ test
βββ java
β βββ steps
β βββ Hooks.java
β βββ OrangeHRMSteps.java
βββ resources
βββ features
β βββ orangehrm.feature
βββ config.example.properties
βββ (config.properties) # local only, ignored by git
-
Clone repo
git clone https://github.com/<YOUR_USERNAME>/OrangeHRM-SeleniumJava.git cd OrangeHRM-SeleniumJava
-
Install requirements
- JDK 17+
- Maven 3.8+
- Google Chrome (latest)
-
Config file Copy the example config and edit with your local values:
cp src/test/resources/config.example.properties src/test/resources/config.properties
Example:
base.url=https://opensource-demo.orangehrmlive.com/ admin.username=Admin admin.password=admin123
-
Run all tests with Maven:
mvn clean test
-
Run from IntelliJ:
- Open
orangehrm.feature
- Click the Run icon in the gutter, or run the Cucumber runner
- Open
.idea/
*.iml
out/
target/
surefire-reports/
test-output/
reports/
screenshots/
src/test/resources/config.properties
*.mp4
*.zip
- **User βalready existsβ**: the add form shows an inline error instead of a toast. Delete the user first or use a unique username.
- **Counts donβt match**: pagination can change totals. Primary check is that the searched username is gone.
---
## π€ Contributing
1. Fork β Branch β Commit β PR
2. Keep selectors resilient (avoid brittle XPaths)
3. Prefer toast/table checks over static labels
---
## π License
MIT