Actions action = new Actions(getDriver());
action.moveToElement(element);
action.moveByOffset(0, 1);
action.clickAndHold();
action.moveByOffset(xOffset, yOffset);
action.release();
action.build().perform();
} else {
Actions action = new Actions(getDriver());
action.dragAndDropBy(element, xOffset, yOffset);
action.build().perform();