This is an overloaded version of the release() method. Using this, you can actually release the currently held WebElement in the middle of another WebElement. In this way, we don't have to calculate the offset of the target WebElement from the held WebElement.
The API syntax is as follows:
public Actions release(WebElement onElement)
The input parameter for the preceding method is obviously the target WebElement, where the held WebElement should be dropped. The return type is the instance of the Actions class.
Let's modify the preceding code example to use this method:
@Testpublic void shouldClickAndHoldAndReleaseOnElement() { driver.get("http://guidebook.seleniumacademy.com/Sortable.html"); WebElement ...