Skip to content

Perform Demo test using selenium java , login, (add, search, Delete & verify Deleting) users , verifying user counts after adding and deleting users

Notifications You must be signed in to change notification settings

ManarBedeir/OrangeHRM-SeleniumJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OrangeHRM UI Tests

End-to-end UI automation for the OrangeHRM demo site using Selenium WebDriver, Cucumber (Gherkin), TestNG, and Maven.


βœ… Features

  • 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

🧰 Tech Stack

  • Java (JDK 17+ / tested with JDK 23)
  • Maven
  • Selenium 4.25.0 + WebDriverManager
  • Cucumber JVM 7.x + TestNG
  • Chrome / Chromedriver

πŸ“¦ Project Structure

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

βš™οΈ Setup

  1. Clone repo

    git clone https://github.com/<YOUR_USERNAME>/OrangeHRM-SeleniumJava.git
    cd OrangeHRM-SeleniumJava
  2. Install requirements

    • JDK 17+
    • Maven 3.8+
    • Google Chrome (latest)
  3. 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 Tests

  • 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

πŸ“„ .gitignore (already included)

.idea/
*.iml
out/
target/
surefire-reports/
test-output/
reports/
screenshots/
src/test/resources/config.properties
*.mp4
*.zip

πŸš‘ Troubleshooting


- **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

About

Perform Demo test using selenium java , login, (add, search, Delete & verify Deleting) users , verifying user counts after adding and deleting users

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published