Shopping Portal Automation Practice (QuickKart)
A hands-on guide to testing a e-commerce application with Selenium and Playwright · TesterRank team
QuickKart is a practice e-commerce store with a product catalog, search and filters, product detail pages, cart, coupons, checkout, orders, returns and a wishlist. It is the classic end-to-end automation project: almost every QA job description mentions an "add to cart and checkout" flow.
Use it to practise data-driven tests (many products, many coupons), price calculations across cart and checkout, and long user journeys that span six or seven pages without becoming flaky.
Demo login
| URL | /shopping/login |
|---|---|
testuser@quickkart.com | |
| Password | Test@123 |
| Key locators | [data-testid='login-email'], [data-testid='login-password'], [data-testid='login-btn'] |
All data is fictional and stored only in your browser. Clear site storage to reset the app.
What makes this app challenging to automate
Price maths across pages
Cart subtotal, coupon discount, tax and final total must agree on the cart and checkout pages. Compute the expected total in your test from the item prices instead of copying it from the UI.
Search and filter combinations
Filters by category and price interact. A good test asserts that every visible product matches all active filters, not just that "some results appear".
Cart state persists
The cart survives reloads. Clear it in a setup step or your tests will pass alone and fail together.
Login via password or OTP
Both login options exist. Practice the OTP input and verify button as a separate flow.
Pages and what to practise on each
| Page | Practise |
|---|---|
| Catalog | Search box, category filters, sorting, product grid assertions. |
| Product details | Quantity selector, add to cart, add to wishlist, image gallery. |
| Cart | Update quantity, remove items, verify subtotal recalculation. |
| Coupons | Valid, expired and minimum-order coupons; discount assertions. |
| Checkout | Address form validation, payment method selection, order confirmation. |
| Orders | Verify a newly placed order appears with correct total and status. |
| Returns | Return request form with reason dropdown and status tracking. |
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 QuickKartLoginTest {
WebDriver driver;
WebDriverWait wait;
@BeforeMethod
public void setUp() {
driver = new ChromeDriver();
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
driver.get("https://www.testerrank.com/shopping/login");
}
@Test
public void validLoginOpensApp() {
driver.findElement(By.cssSelector("[data-testid='login-email']"))
.sendKeys("testuser@quickkart.com");
driver.findElement(By.cssSelector("[data-testid='login-password']"))
.sendKeys("Test@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('QuickKart login', () => {
test.beforeEach(async ({ page }) => {
await page.goto('https://www.testerrank.com/shopping/login');
});
test('valid credentials open the app', async ({ page }) => {
await page.getByTestId('login-email').fill('testuser@quickkart.com');
await page.getByTestId('login-password').fill('Test@123');
await page.getByTestId('login-btn').click();
await expect(page).not.toHaveURL(/login/);
});
test('wrong password shows an error', async ({ page }) => {
await page.getByTestId('login-email').fill('testuser@quickkart.com');
await page.getByTestId('login-password').fill('Wrong@999');
await page.getByTestId('login-btn').click();
await expect(page).toHaveURL(/login/);
});
});Guided exercises
- Search for a product and verify results (beginner)Automate a product search and verify that the results match the search query.
- Add product to cart and verify cart total (beginner)Add a product to the shopping cart and verify the cart total reflects the product price.
- Sort products by price ascending/descending (beginner)Verify the product sorting functionality works for price-based ordering.
- Filter products by category (beginner)Test the category filter and verify only products from the selected category are shown.
- Test signup with invalid email format (beginner)Verify client-side and server-side validation for email format during signup.
- Complete checkout with valid address (intermediate)Automate the full checkout flow from cart to order confirmation.
- Apply a discount code and verify price (intermediate)Test that applying a valid discount code reduces the cart total correctly.
- Remove item from cart and verify updated total (intermediate)Verify that removing an item from the cart updates the total and item count.
- Add product to wishlist (intermediate)Automate adding a product to the wishlist and verify it persists across sessions.
- Verify order history after purchase (advanced)Complete a purchase and verify the order appears in the order history with correct details.
Edge cases worth testing
- Apply a coupon whose minimum order value is higher than the cart total.
- Set quantity to 0 or above available stock.
- Remove the last item from the cart during checkout in another tab.
- Submit checkout with an invalid PIN code or phone number.
Test case writing practice
Before automating, write manual test cases. This portal has 34 reference scenarios across Product Search, Checkout & Payment, Shopping Cart, Order Tracking & Returns. Try the test case challenge.
Interview questions from this app
Which e-commerce flows would you automate first?
The money path: search → product → cart → checkout → order confirmation. It has the highest business risk and is run in every regression. Edge cases like coupons and returns come next.
How do you avoid flaky cart tests?
Start every test from a known state (empty cart via storage or API), wait for the cart count/total to update instead of using sleeps, and assert on calculated values.