There are times where we need to only move an image by a certain amount. A good example of this would be if you are working in a WYSIWYG editor and you wanted to just move an image to somewhere else but did not want to drop it on another element, you will be using
dragAndDropBy(WebElement, x, y);.
Let us see this in action.
WebDriver driver = new FirefoxDriver(); co.uk/demo2.html"); WebElement drag = driver.findElement(By.className("draggable")); Actions builder = new Actions(driver); Action dragAndDrop = builder.dragAndDropBy(drag, 10, 20) .build(); dragAndDrop.perform(); ...