WebElement draggable3 = driver.findElement(By.id("ABC"));
new Actions(driver).dragAndDropBy(draggable3, 400, 90).build().perform();
public boolean isAlertPresent() { try { driver.switchTo().alert(); return true; } // try catch (NoAlertPresentException Ex) { return false; } // catch}
if(isAlertPresent()){ driver.switchTo().alert().accept(); }