Selenium Java - Handling Windows, Frames, and Alerts
Identify the error in this Selenium Java code for entering text in a prompt alert:
Alert alert = driver.switchTo().alert();
alert.sendKeys("test");
alert.dismiss();