Automation lab Aú API Interaction & Mocking (API_INTERACTION)

Lab 040: API response caching behavior

Practice api response caching behavior 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 api response caching behavior.
  • Design stable locators for key UI elements.
  • Automate user interactions and verify the resulting UI state.

Sandbox

API & Network • api • intermediate • active

API response caching behavior

First fetch hits network, subsequent fetches served from cache until cleared.

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

Learning objectives

  • Track cache hit vs network fetch.
  • Clear cache on demand.
  • Expose state for assertions.

Steps

  1. Fetch first time → network.
  2. Fetch again → cache.
  3. Clear cache and fetch → network again.

Practice sandbox

Simulate cache hits.

State

Cache status: empty

Item Owner

Idle

Assertions to practice

  • First fetch hits network and fills cache.
  • Second fetch served from cache.
  • Clear resets state to empty cache.