Selenium Java - Handling Windows, Frames, and Alerts
Identify the error in the following Selenium Java code snippet:
driver.findElement(By.id("popup")).click();
driver.switchTo().defaultContent();
driver.switchTo().window("popupWindow");
driver.findElement(By.id("close")).click();