Automation lab Aú State & Session Management (STATE_SESSION)

Lab 042: Refresh token flow after 401

Practice refresh token flow after 401 in a real web app context as part of the State & Session Management module.

intermediate intermediate
intermediate

Objectives

Use for test scripts
  • Understand the purpose and business flow of refresh token flow after 401.
  • Design stable locators for key UI elements.
  • Automate user interactions and verify the resulting UI state.

Sandbox

Auth & Session • auth • intermediate • active

Refresh token flow after 401

Handle 401, refresh token, and retry the protected request.

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

Learning objectives

  • Detect 401 on protected call.
  • Execute refresh token flow.
  • Retry original call after refresh.

Steps

  1. Call protected endpoint → 401.
  2. Refresh token → 200.
  3. Retry original call → success.

Practice sandbox

Trigger 401 then refresh.

Idle

Assertions to practice

  • 401 triggers refresh flow.
  • Refresh call returns 200.
  • Original call succeeds after refresh.