How to Drag and Drop by co-ordinates in Webdriver

 


    WebElement draggable3 = driver.findElement(By.id("ABC"));
        new Actions(driver).dragAndDropBy(draggable3, 400, 90).build().perform();

Check whether Javascript pop up displayed with Webdriver

public boolean isAlertPresent()
{
    try    {
        driver.switchTo().alert();
        return true;
    }   // try    catch (NoAlertPresentException Ex)
    {
        return false;
    }   // catch}
 
 
if(isAlertPresent()){
  driver.switchTo().alert().accept();
}