Skip to main content

CRM Portal Automation Practice (SalesHub)

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

SalesHub is a CRM for sales teams: leads, lead details, contacts, a deals pipeline, activities and reports. It is data-heavy, with large tables, filters, sorting and status changes — the bread and butter of enterprise SaaS testing.

If you are preparing for a SaaS product company, this portal gives you realistic table and pipeline scenarios: sorting verification, bulk actions, and moving a deal between stages.

Demo login

URL/crm/login
Emailvikram@saleshub.com
PasswordSales@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

Table sorting verification

Read all values in a column, sort a copy in code, and compare it with the UI order after clicking the header.

Pipeline stage changes

Deals move through stages. Verify totals per stage update when a deal moves.

Lead to contact conversion

Converting a lead should create a contact and remove/mark the lead. Assert both sides.

Reports and charts

Verify report numbers match the underlying lead/deal data.

Pages and what to practise on each

PagePractise
LeadsLarge table, filters, sorting, pagination, bulk select.
Lead detailsEdit fields, add notes, change status.
ContactsSearch and contact cards.
DealsPipeline stages and deal value totals.
ActivitiesCreate tasks/calls with dates, mark complete.
ReportsSummary numbers and chart data checks.

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

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

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

  test('valid credentials open the app', async ({ page }) => {
    await page.getByTestId('email-input').fill('vikram@saleshub.com');
    await page.getByTestId('password-input').fill('Sales@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('vikram@saleshub.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. Create and Qualify a New Sales Lead (intermediate)
    Verify sales lead generation and status pipeline transition.
  2. Drag and Drop Deal Across Pipeline Stages (intermediate)
    Test interactive Kanban deal movements from Qualification to Proposal to Closed Won.
  3. Contact Management & Duplicate Email Detection (beginner)
    Test contact creation and duplicate detection alert handling.
  4. Filter Leads by Deal Size and Stage (intermediate)
    Verify complex filter criteria on sales opportunities table.
  5. Generate and Export Sales Performance Report (advanced)
    Automate sales analytics report generation and CSV data export.
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 18 reference scenarios across Lead Management & Creation, Deals & Pipeline Kanban, Customer Support Tickets & SLA, Contact Activity Timeline & Email Sync. Try the test case challenge.

Interview questions from this app

How do you verify table sorting with Selenium?

Collect the column cells with findElements, map them to text, create a sorted copy (Collections.sort or a stream), and assert the two lists are equal.

How do you handle pagination?

Loop: read rows on the current page, click Next while it is enabled, and aggregate results. Assert total count matches the summary.

Keep learning