Back to Practice

Alerts

Alerts

Click Button to see alert
On button click, alert will appear after 5 seconds
On button click, confirm box will appear
On button click, prompt box will appear

QA Automation Helper

Target IDsKey Element IDs

#alertButton
#timerAlertButton
#confirmButton
#promtButton

Advance Testing Tips

  • Native Dialogs: These are NOT HTML elements. You cannot inspect them with DevTools.
  • Handling: Use driver.switchTo().alert() to accept(), dismiss(), or sendKeys().
  • Timing: For the timer alert, ensure you use an Explicit Wait for the alert to be present before switching.