Automation lab Aú API Interaction & Mocking (API_INTERACTION)

Lab 039: Offline mode when API is unreachable

Practice offline mode when api is unreachable in a real web app context as part of the API Interaction & Mocking module.

intermediate intermediate
intermediate

Objectives

Use for test scripts
  • Understand the purpose and business flow of offline mode when api is unreachable.
  • Design stable locators for key UI elements.
  • Automate user interactions and verify the resulting UI state.

Sandbox

API & Network • api • intermediate • active

Offline mode when API is unreachable

Switch between online/offline states and show cached data offline.

Reading and understanding requirements Choosing stable locators Designing assertions based on business rules

Learning objectives

  • Detect offline mode.
  • Render cached data fallback.
  • Show offline banner and disable fetch.

Steps

  1. Toggle offline mode.
  2. Attempt fetch; confirm offline message and cached rows.
  3. Toggle back online; fetch live data.

Practice sandbox

Toggle offline and load data.

Name Status
Cached UserCached

Online - ready

Assertions to practice

  • Offline prevents live fetch and shows banner.
  • Cached rows render when offline.
  • Online mode fetches and replaces data.