Dragging and dropping elements using selenium

For dragging and dropping objects we make use of Actions class We make use of a function called dragAndDrop(src,dest).build().perform())of Actions class

WebElement src = driver.findElement(By.xpath("//*[@id='draggable']"));
WebElement dest = driver.findElement(By.xpath("//*[@id='droppable']"));
Actions act = new Actions(driver);
act.dragAndDrop(src,dest).build().perform();

Note if we only have the src and not the destination ,but instead we have the x and y cordinates where we want to drop our src we can use the

act.dragAndDropBy(src,50,10).build().perform();