Alerts
The browser's own dialogs. While one is open, the page cannot be used until the test accepts or dismisses it.
Result: No dialog yet
| Button | Dialog | Result after Accept | Result after Dismiss |
|---|---|---|---|
| Show an alert | Hello from the practice page. | Alert closed | Alert closed |
| Ask to confirm | Delete the item? | Deleted | Kept |
| Ask for a name | Your name? (default Guest) | Hello, Guest | No name given |
| Alert in 1.5 seconds | This alert waited 1.5 seconds. | Late alert closed | Late alert closed |
What to practise
- Check the text of each dialog, accept or dismiss it, and read the result.
- The last button opens its alert only after 1.5 seconds: the test has to wait for it.
In VAF: browser.Should().HaveAlert().HaveText("…").Accept().