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 |
|---|---|
amit@loanbazaar.com | |
| Password | Loan@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
| Page | Practise |
|---|---|
| EMI calculator | Range sliders, computed EMI, total interest assertions. |
| Apply | Multi-step form, field validation, step navigation. |
| Credit check | Score display and eligibility messages. |
| Verification | Document checklist and upload states. |
| Applications | Status table and filtering by status. |
| Repayment | Schedule 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.
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(); }
}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
- Calculate Personal Loan EMI (beginner)Test the Loan EMI calculator with standard personal loan inputs and verify real-time computation.
- Submit Instant Loan Application (intermediate)Automate filling out personal loan application form with employment verification.
- Document Upload & KYC Validation (intermediate)Automate uploading proof of identity and salary slip documents for loan approval.
- Credit Score Check & Eligibility Rules (intermediate)Test credit check inquiry and verify loan eligibility band response.
- Repayment Schedule & Pre-closure Calculations (advanced)Validate loan amortization schedule table and pre-payment penalty calculator.
Edge cases worth testing
- Interest rate or tenure at slider min/max values.
- Invalid PAN formats (lowercase, wrong length, digits in wrong place).
- Navigating back from step 3 to step 1 and checking data is retained.
- Applying for an amount above the eligible limit.
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.