How to Test Loading States on Web (Complete Guide)

Loading states are a critical aspect of Web applications, as they directly impact the user experience. A well-designed loading state can make a significant difference in user engagement and satisfacti

June 04, 2026 · 3 min read · How-To Guides

Introduction to Loading States Testing

Loading states are a critical aspect of Web applications, as they directly impact the user experience. A well-designed loading state can make a significant difference in user engagement and satisfaction. However, common failures in loading states can lead to frustration, abandonment, and a negative perception of the application. Loading states testing matters because it ensures that the application handles different scenarios correctly, providing a smooth and seamless experience for users.

What to Test

The following are specific test cases for loading states:

+ Initial page load with a small amount of data

+ Initial page load with a large amount of data

+ Subsequent page loads with cached data

+ Subsequent page loads with updated data

+ Network error (e.g., 404, 500, timeout)

+ Data parsing error

+ Authentication error

+ Slow network connection

+ Low device memory

+ Browser zoomed in/out

+ Screen reader announcement of loading state

+ High contrast mode support

+ Keyboard navigation support

Examples of test cases include:

Manual Testing Approach

Manual testing of loading states involves simulating different scenarios and verifying the application's behavior. Here's a step-by-step approach:

  1. Prepare test environments: Set up different test environments with varying network speeds, device types, and browsers.
  2. Test happy path scenarios: Load the application with small and large amounts of data, and verify that the loading indicator is displayed and removed correctly.
  3. Test error scenarios: Simulate network errors, data parsing errors, and authentication errors, and verify that the application handles them correctly.
  4. Test edge cases: Test the application with slow network connections, low device memory, and browser zoomed in/out.
  5. Test accessibility considerations: Verify that the application is accessible on different devices and browsers, and that screen readers announce the loading state correctly.

Automated Testing Approach

Automated testing of loading states can be done using tools like Playwright or Cypress. Here's an example of how to write a test using Playwright:


const { test, expect } = require('@playwright/test');

test('loading state', async ({ page }) => {
  // Load the application
  await page.goto('https://example.com');

  // Verify that the loading indicator is displayed
  await expect(page.locator('.loading-indicator')).toBeVisible();

  // Wait for the data to be loaded
  await page.waitForSelector('.data-loaded');

  // Verify that the loading indicator is removed
  await expect(page.locator('.loading-indicator')).not.toBeVisible();
});

Automated testing can also be done using frameworks like Jest or Mocha, and libraries like Axios or Fetch.

How SUSA Tests Loading States Autonomously

SUSA tests loading states autonomously using its 10 user personas, including:

SUSA's autonomous testing approach ensures that loading states are thoroughly tested, providing a smooth and seamless experience for users. SUSA's testing approach includes:

SUSA's testing approach can be integrated with CI/CD pipelines using GitHub Actions, JUnit XML, or CLI tool (pip install susatest-agent).

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free