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 |
|---|---|
vikram@saleshub.com | |
| Password | Sales@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
| Page | Practise |
|---|---|
| Leads | Large table, filters, sorting, pagination, bulk select. |
| Lead details | Edit fields, add notes, change status. |
| Contacts | Search and contact cards. |
| Deals | Pipeline stages and deal value totals. |
| Activities | Create tasks/calls with dates, mark complete. |
| Reports | Summary 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.
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(); }
}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
- Create and Qualify a New Sales Lead (intermediate)Verify sales lead generation and status pipeline transition.
- Drag and Drop Deal Across Pipeline Stages (intermediate)Test interactive Kanban deal movements from Qualification to Proposal to Closed Won.
- Contact Management & Duplicate Email Detection (beginner)Test contact creation and duplicate detection alert handling.
- Filter Leads by Deal Size and Stage (intermediate)Verify complex filter criteria on sales opportunities table.
- Generate and Export Sales Performance Report (advanced)Automate sales analytics report generation and CSV data export.
Edge cases worth testing
- Create a lead with a duplicate email address.
- Sort by a column containing empty values.
- Filter that returns zero results — check the empty state message.
- Move a deal to Closed Won and verify the revenue report updates.
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.