This project is a comprehensive automated functional testing suite for the OrangeHRM Demo Website using Selenium WebDriver, Java, and TestNG framework. The test suite demonstrates advanced browser automation capabilities including login validation, file uploads, multi-window handling, downloads, and data-driven testing.
URL: https://opensource-demo.orangehrmlive.com/
- Java 11
- Selenium WebDriver 4.15.0
- TestNG 7.8.0
- WebDriverManager 5.6.2
- Apache Commons IO 2.15.0
- Maven 3.x
- Chrome Browser (Latest)
orange-Hrm/
├── pom.xml # Maven configuration
├── testng.xml # TestNG suite configuration
├── src/
│ └── test/
│ └── java/
│ ├── LoginTests.java # Login functionality tests
│ ├── EmployeeProfileTests.java # Profile & screenshot tests
│ ├── WindowAndDownloadTests.java # Multi-window & download tests
│ └── DataDrivenLoginTests.java # Data-driven login tests
├── test-resources/
│ └── sample-profile.jpg # Sample image for upload testing
├── screenshots/ # Captured screenshots from tests
└── README.md # Project documentation
Purpose: Validate login functionality with positive and negative scenarios
Test Cases:
- ✅
testValidLogin()- Verify successful login with valid credentials - ✅
testInvalidLogin()- Verify error message for invalid credentials - ✅
testEmptyCredentialsLogin()- Verify validation for empty fields
Groups: Smoke, Regression
Purpose: Test profile navigation and screenshot capture functionality
Test Cases:
- ✅
testProfileImageUpload()- Navigate to My Info and verify profile page - ✅
testMyInfoPageLoad()- Verify My Info page loads correctly
Features:
- Automated screenshot capture using Apache Commons IO
- Profile page navigation and validation
- Screenshots saved to
/screenshotsdirectory
Groups: Smoke, Regression
Purpose: Demonstrate multi-window handling and download capabilities
Test Cases:
- ✅
testMultipleWindowHandling()- Open new window, switch contexts, and verify - ✅
testFileDownload()- Configure download directory and attempt file download - ✅
testTabSwitching()- Open multiple tabs and switch between them
Features:
- Window handle management
- JavaScript executor for window operations
- Download directory configuration
- Tab switching and context management
Groups: Smoke, Regression
Purpose: Implement data-driven testing using TestNG DataProvider
Test Cases:
- ✅
testValidLoginWithDataProvider()- Data-driven valid login test - ✅
testInvalidLoginWithDataProvider()- Test multiple invalid credential combinations - ✅
testLoginWithVariousScenarios()- Comprehensive login scenarios - ✅
testLoginWithCaseVariations()- Test username case sensitivity - ✅
testLoginWithSpecialCharacters()- Test special characters in credentials
Data Providers:
validLoginData- Valid credential combinationsinvalidLoginData- Invalid credential combinationsallLoginData- Mixed valid/invalid scenarios
Groups: Smoke, Regression, DataDriven
- Java JDK 11 or higher
- Maven 3.6+
- Google Chrome browser (latest version)
- Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/Ap13ayush/orange-Hrm.git cd orange-Hrm -
Install dependencies:
mvn clean install
-
Verify setup:
mvn clean compile
mvn clean test# Run login tests only
mvn test -Dtest=LoginTests
# Run profile tests only
mvn test -Dtest=EmployeeProfileTests
# Run window/download tests only
mvn test -Dtest=WindowAndDownloadTests
# Run data-driven tests only
mvn test -Dtest=DataDrivenLoginTests# Run smoke tests only
mvn test -Dgroups=Smoke
# Run regression tests only
mvn test -Dgroups=Regression
# Run data-driven tests only
mvn test -Dgroups=DataDrivenmvn test -DsuiteXmlFile=testng.xmlAfter running tests, reports are generated in:
- TestNG HTML Reports:
target/surefire-reports/index.html - XML Reports:
target/surefire-reports/ - Screenshots:
screenshots/
The project uses TestNG annotations for test organization:
@BeforeMethod- Browser setup before each test@AfterMethod- Browser cleanup after each test@Test- Test method with priority and groups@DataProvider- Data-driven test input
Automatic browser driver management - no manual ChromeDriver download required.
Tests are organized into logical groups:
- Smoke - Critical functionality tests
- Regression - Comprehensive test coverage
- DataDriven - Parameterized tests
All tests use WebDriverWait for reliable element synchronization.
Automated screenshot capture for profile tests with timestamp.
Multiple test scenarios executed with different input combinations using TestNG DataProvider.
Demonstrates advanced Selenium capabilities for handling multiple browser windows and tabs.
✅ Total Tests: 22
✅ Passed: 22
❌ Failed: 0
Execution Time: ~4 minutes (full suite)
Solution: WebDriverManager automatically handles this. Ensure you have internet connectivity for first run.
Solution: Increase wait timeout in test classes (default: 10-15 seconds).
Solution: The directory is created automatically. Ensure write permissions.
- Page Object Model - Separation of test logic and page interactions
- Explicit Waits - Reliable element synchronization
- Test Independence - Each test can run independently
- Proper Assertions - Clear test validations
- Resource Cleanup - Browser quit in @AfterMethod
- Meaningful Logging - Console output for debugging
- Test Organization - Groups and priorities
- Data-Driven Approach - Reusable test logic