Automation lab Aú API Interaction & Mocking (API_INTERACTION)

Lab 031: Mock API response for table data

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

Sandbox

API & Network • api • intermediate • active

Mock API response for table data

Simulate API fetch success and failure for a table.

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

Learning objectives

  • Mock success and error responses.
  • Render table rows from fetched data.
  • Show status and error banners.

Steps

  1. Trigger success fetch and assert rows.
  2. Trigger error fetch and assert banner.
  3. Inspect status text for each state.

Practice sandbox

Fetch mock data.

Name Role

Idle

Assertions to practice

  • Status transitions: Idle → Loading → Success/Error.
  • Error banner visible on failure.
  • Rows match mock payload on success.