Automation lab Aú Error Handling & Resilience (ERROR_RESILIENCE)
Lab 058: File upload error handling
Practice file upload error handling in a real web app context as part of the Error Handling & Resilience module.
advanced
advanced
Objectives
Use for test scripts- Understand the purpose and business flow of file upload error handling.
- Design stable locators for key UI elements.
- Automate user interactions and verify the resulting UI state.
Sandbox
Error Handling & Resilience / error-handling / advanced / active
File upload error handling
Validate file type and size; show clear errors.
Reading and understanding requirements
Choosing stable locators
Designing assertions based on business rules
Learning objectives
- Accept only .png files.
- Reject files over 2MB.
- Expose success/error states for tests.
Steps
- Choose file; see validation result.
- Ensure error for wrong type/size.
- Success message for valid file.
No file selected
Assertions to practice
- Error when file type is not .png.
- Error when size > 2MB (simulated via size input).
- Success message for valid PNG under limit.