Skip to main content

Loan Portal Automation Practice (LoanBazaar)

A hands-on guide to testing a digital lending application with Selenium and Playwright · TesterRank team

LoanBazaar walks through a digital loan journey: EMI calculator, multi-step application, credit check, document verification, disbursement and repayment tracking. It is a realistic fintech workflow where each step depends on the previous one.

Use it to practise multi-step wizards, financial calculations (EMI formula), and status-driven assertions — skills that transfer directly to fintech and NBFC projects.

Demo login

URL/loan/login
Emailamit@loanbazaar.com
PasswordLoan@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

EMI formula verification

EMI = P·r·(1+r)^n / ((1+r)^n − 1). Compute it in your test and compare with the UI, allowing for rounding.

Multi-step application wizard

Each step validates before moving on. Test both the happy path and going Back to edit earlier steps without losing data.

PAN and phone format validation

Inputs follow Indian formats (PAN like ABCDE1234F). Great practice for regex-based negative tests.

Repayment schedule tables

Verify that the sum of principal components in the schedule equals the loan amount.

Pages and what to practise on each

PagePractise
EMI calculatorRange sliders, computed EMI, total interest assertions.
ApplyMulti-step form, field validation, step navigation.
Credit checkScore display and eligibility messages.
VerificationDocument checklist and upload states.
ApplicationsStatus table and filtering by status.
RepaymentSchedule table, paid/unpaid states, totals.

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

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

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

  test('valid credentials open the app', async ({ page }) => {
    await page.getByTestId('email-input').fill('amit@loanbazaar.com');
    await page.getByTestId('password-input').fill('Loan@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('amit@loanbazaar.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. Calculate Personal Loan EMI (beginner)
    Test the Loan EMI calculator with standard personal loan inputs and verify real-time computation.
  2. Submit Instant Loan Application (intermediate)
    Automate filling out personal loan application form with employment verification.
  3. Document Upload & KYC Validation (intermediate)
    Automate uploading proof of identity and salary slip documents for loan approval.
  4. Credit Score Check & Eligibility Rules (intermediate)
    Test credit check inquiry and verify loan eligibility band response.
  5. Repayment Schedule & Pre-closure Calculations (advanced)
    Validate loan amortization schedule table and pre-payment penalty calculator.
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 Loan Application, EMI Calculator, Loan Repayment & Foreclosure, Co-Applicant Verification. Try the test case challenge.

Interview questions from this app

How would you test a multi-step form?

Test each step’s validation in isolation, then the full happy path, then navigation (back/forward/refresh) and data retention. Use a page object per step.

How do you assert computed financial values?

Calculate the expected value in code from the inputs, round the same way the business rules say, and compare — never copy the expected number from the UI.

Keep learning