Objective
What to automate
Accept the alert and verify the visible alert result.
Preconditions and test data
Preconditions
- Use a fresh isolated Practice Lab browser context.
- Open the fixture identified by FX-DIALOG-001.
Test data
dialog type: alert
Expected result
The page reports that the alert was accepted.
Progressive hints
Hint 1
Register the dialog handler before clicking.
Hint 2
Assert the dialog type or message in the handler.
Hint 3
Check the visible result after accept().
I’ve tried it — show solution
- Register the dialog handler before clicking.
- Assert the dialog type or message in the handler.
- Check the visible result after accept().