Skip to main content

Insurance Portal Automation Practice (PolicyDekho)

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

The insurance portal covers what a policyholder does online: calculate a premium, view and renew policies, add nominees, upload documents, file a claim, pay premiums and raise support tickets. These flows are form-heavy and rule-heavy, which makes them excellent practice for validation testing.

Insurance and other BFSI projects hire many testers. Practising here gives you concrete examples to talk about: premium formulas, nominee share totals that must equal 100%, and document upload limits.

Demo login

URL/insurance/login
Emailrajesh@insurance.com
PasswordInsure@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

Premium calculator rules

Premium depends on age, cover amount and tenure. Write a data-driven test with a table of inputs and expected outputs (boundary ages are where bugs hide).

Nominee share validation

Shares across nominees must total 100%. Test 99%, 100% and 101% — classic boundary value analysis.

File uploads

The documents page accepts uploads. Practice sendKeys/setInputFiles and test file type and size limits.

Claim status lifecycle

A claim moves through statuses. Verify the status badge and timeline after each step.

Pages and what to practise on each

PagePractise
Premium calculatorSliders, number inputs and computed premium assertions.
PoliciesPolicy list table, details view, status filters.
NomineesAdd/edit nominees, share percentage validation.
DocumentsFile upload, file type validation, delete uploaded file.
ClaimsMulti-field claim form, claim status tracking.
RenewRenewal flow with premium summary and payment.
SupportTicket creation form and ticket list verification.

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 PolicyDekhoLoginTest {
    WebDriver driver;
    WebDriverWait wait;

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

    @Test
    public void validLoginOpensApp() {
        driver.findElement(By.cssSelector("[data-testid='email-input']"))
              .sendKeys("rajesh@insurance.com");
        driver.findElement(By.cssSelector("[data-testid='password-input']"))
              .sendKeys("Insure@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('PolicyDekho login', () => {
  test.beforeEach(async ({ page }) => {
    await page.goto('https://www.testerrank.com/insurance/login');
  });

  test('valid credentials open the app', async ({ page }) => {
    await page.getByTestId('email-input').fill('rajesh@insurance.com');
    await page.getByTestId('password-input').fill('Insure@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('rajesh@insurance.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. Get a health insurance quote (beginner)
    Automate the process of getting a health insurance quote by filling out the required details.
  2. Check policy details page (beginner)
    Verify the policy details page displays all relevant information for an existing policy.
  3. Compare two insurance plans (intermediate)
    Use the plan comparison feature to compare two different insurance plans side by side.
  4. Submit an insurance claim with documents (intermediate)
    Automate filing an insurance claim including document upload.
  5. Verify premium calculator output (intermediate)
    Test the premium calculator with various inputs and validate the calculated premiums.
  6. Upload claim documents (intermediate)
    Test the document upload functionality for an existing insurance claim.
  7. Verify beneficiary details form (intermediate)
    Test the beneficiary details form validation and submission.
  8. Track claim status changes (advanced)
    Verify that claim status transitions are displayed correctly in the claim timeline.
  9. Test policy renewal flow (advanced)
    Automate the end-to-end policy renewal process for an expiring policy.
  10. Calculate premium for different age groups (advanced)
    Validate that the premium calculation correctly adjusts for different age brackets.
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 24 reference scenarios across Premium Calculator, Claim Filing, Policy Renewal & Grace Period, KYC Document Verification. Try the test case challenge.

Interview questions from this app

How do you test a premium calculator?

Use equivalence partitioning and boundary values on each input, keep the test data in a CSV/Excel or TestNG DataProvider, and compare the UI result with an expected value computed from the business formula.

How do you automate file upload in Selenium?

Locate the input[type=file] element and call sendKeys with the absolute file path. No need to interact with the OS dialog.

Keep learning