Skip to main content

HRMS Portal Automation Practice (GreytPeople)

A hands-on guide to testing a human resources management application with Selenium and Playwright · TesterRank team

GreytPeople is an HR management system with employee directory, attendance, leave requests, payroll slips, performance reviews, onboarding and announcements. It includes an employee user and an HR Manager user, which lets you test approval workflows end to end.

HRMS products are tested by many service companies. The leave approval flow — employee applies, manager approves, balance updates — is a common interview scenario for designing an end-to-end test.

Demo login

URL/hrms/login
Emailrahul@greytpeople.com
PasswordHrms@123
Key locators[data-testid='email-input'], [data-testid='password-input'], [data-testid='login-btn'], [data-testid='login-error']

All data is fictional and stored only in your browser. Clear site storage to reset the app.

What makes this app challenging to automate

Leave balance updates

After applying for leave, the balance should reduce by the number of working days. Weekends and overlapping dates are where bugs live.

Approval workflow across users

Apply as Rahul (employee), then log in as Priya (HR Manager) to approve. Practise switching users within one test or using two browser contexts.

Attendance calendar

Calendar widgets require locating cells by date — practise dynamic XPath/CSS built from a date.

Directory search

Search by name, department or designation and verify every card matches.

Pages and what to practise on each

PagePractise
Employee directorySearch, department filter, profile cards.
AttendanceCalendar navigation, check-in/check-out states.
LeaveDate range pickers, leave type dropdown, balance assertions.
PayrollSalary slip tables, earnings vs deductions totals.
PerformanceRatings, review forms, goal progress.
OnboardingChecklist tasks and progress tracking.

Starter code: login test

Both examples use the app's stable data-testid attributes, which is the locator strategy most teams prefer over long XPaths. Copy one into your project, run it, then extend it to the pages above.

Selenium 4 + Java + TestNG
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.*;
import org.testng.Assert;
import org.testng.annotations.*;
import java.time.Duration;

public class GreytPeopleLoginTest {
    WebDriver driver;
    WebDriverWait wait;

    @BeforeMethod
    public void setUp() {
        driver = new ChromeDriver();
        wait = new WebDriverWait(driver, Duration.ofSeconds(10));
        driver.get("https://www.testerrank.com/hrms/login");
    }

    @Test
    public void validLoginOpensApp() {
        driver.findElement(By.cssSelector("[data-testid='email-input']"))
              .sendKeys("rahul@greytpeople.com");
        driver.findElement(By.cssSelector("[data-testid='password-input']"))
              .sendKeys("Hrms@123");
        driver.findElement(By.cssSelector("[data-testid='login-btn']")).click();

        // Explicit wait: the URL leaves the login page after success
        wait.until(ExpectedConditions.not(
            ExpectedConditions.urlContains("/login")));
        Assert.assertFalse(driver.getCurrentUrl().contains("/login"));
    }

    @AfterMethod
    public void tearDown() { driver.quit(); }
}
Playwright + TypeScript
import { test, expect } from '@playwright/test';

test.describe('GreytPeople login', () => {
  test.beforeEach(async ({ page }) => {
    await page.goto('https://www.testerrank.com/hrms/login');
  });

  test('valid credentials open the app', async ({ page }) => {
    await page.getByTestId('email-input').fill('rahul@greytpeople.com');
    await page.getByTestId('password-input').fill('Hrms@123');
    await page.getByTestId('login-btn').click();
    await expect(page).not.toHaveURL(/login/);
  });

  test('wrong password shows an error', async ({ page }) => {
    await page.getByTestId('email-input').fill('rahul@greytpeople.com');
    await page.getByTestId('password-input').fill('Wrong@999');
    await page.getByTestId('login-btn').click();
  await expect(page.getByTestId('login-error')).toBeVisible();
  });
});

Guided exercises

  1. Submit Leave Application and Check Balance (beginner)
    Automate paid time off (PTO) request and balance deduction check.
  2. Daily Attendance Clock-In & Time Tracking (beginner)
    Automate employee attendance punch-in and session timestamp validation.
  3. Employee Directory Search & Department Filter (intermediate)
    Verify employee search functionality with department and location facets.
  4. Monthly Salary Slip Download & Tax Deduction (intermediate)
    Verify payroll breakdown and salary slip generation for employees.
  5. Submit Annual Performance Review Appraisal (advanced)
    Automate self-appraisal form submission with milestone ratings and goals.
See step-by-step instructions and expected results →

Edge cases worth testing

Test case writing practice

Before automating, write manual test cases. This portal has 19 reference scenarios across Leave Application & Approval, Attendance & Clock-In, Payroll & Salary Slip Generation, Employee Onboarding & Document Checklist. Try the test case challenge.

Interview questions from this app

How would you automate a workflow involving two users?

Use separate browser contexts/sessions (Playwright contexts or two WebDriver instances), or log out and back in. Keep each user’s actions in their own page objects.

How do you select a date in a custom calendar?

Navigate months until the target month is visible, then locate the day cell with a locator built from the date (e.g. a data attribute or aria-label). Avoid fixed indexes.

Keep learning