I'm working on a test that performs a drag and drop.
My code currently:
WebElement element;
By mainSelector, secondarySelector;
Actions action;
action = new Actions(driver);
mainSelector = By.cssSelector("tbody.naam tr:nth-child(1) td:nth-child(1)");
secondarySelector = By.cssSelector("tbody.bedrijf tr:nth-child(1) td:nth-child(1)");
action.click(driver.findElement(mainSelector));
action.clickAndHold(driver.findElement(mainSelector))
.moveToElement(driver.findElement(secondarySelector), 5, 5)
.perform();
action.release(driver.findElement(secondarySelector));
action.perform();
action.dragAndDropBy(driver.findElement(mainSelector), 300, 300).perform();
action.dragAndDrop(driver.findElement(mainSelector), driver.findElement(secondarySelector)).perform();
But this does not do anything. I have added multiple performs so be sure that that is not the problem. I have added an offset because i read that this sometimes is buggy. I used firefox for testing.