Automation lab Aú API Interaction & Mocking (API_INTERACTION)
Lab 032: Validate API request body content
Practice validate api request body content in a real web app context as part of the API Interaction & Mocking module.
intermediate
intermediate
Objectives
Use for test scripts- Understand the purpose and business flow of validate api request body content.
- Design stable locators for key UI elements.
- Automate user interactions and verify the resulting UI state.
Sandbox
API & Network • api • intermediate • active
Validate API request body content
Build a request payload and ensure required fields are present.
Reading and understanding requirements
Choosing stable locators
Designing assertions based on business rules
Learning objectives
- Serialize form inputs to JSON.
- Validate presence of required keys.
- Expose request preview for assertions.
Steps
- Fill fields (name, email, role).
- Submit to build request body.
- Assert required keys exist and are non-empty.
- Check status text reflects validation.
Practice sandbox
Compose an API request body.
Request body
{}
Waiting for input
Assertions to practice
- Required: name, email, role.
- Status shows success when all present.
- Preview JSON matches inputs.