Selenium Webdriver NoAlertPresentException: no alert open


/ / Click to save
driver.findElement (By.xpath ("/ / * [@ id=" btn-submit "]")). Click ();
) and then there is a pop-up box. You need to click to confirm
/ / I thought this was alter

.

Alert javascriptConfirm = driver.switchTo (). Alert ();
javascriptConfirm.accept ();

but error:
Exception in thread "main" org.openqa.selenium.NoAlertPresentException: no alert open


as soon as I asked the question, I solved it by myself. It was really embarrassing.
sleep was ready in 2 seconds.
executed too fast. Before alter came out, selenium went to execute

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3321f-2be51.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3321f-2be51.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?