Complete the code to create an Actions object for drag and drop.
Actions actions = new Actions(driver);
actions.[1](sourceElement, targetElement).perform();The dragAndDrop method performs the drag and drop action from the source element to the target element.
Complete the code to perform drag and drop using clickAndHold, moveToElement, and release.
Actions actions = new Actions(driver);
actions.[1](sourceElement).moveToElement(targetElement).release().perform();The clickAndHold method clicks and holds the source element, allowing chaining with moveToElement and release to complete drag and drop.
Fix the error in the code to correctly perform drag and drop.
Actions actions = new Actions(driver);
actions.clickAndHold(sourceElement).[1](targetElement).release().perform();The moveToElement method moves the held element to the target element before releasing it, completing the drag and drop.
Fill both blanks to chain the correct drag and drop actions.
Actions actions = new Actions(driver); actions.[1](sourceElement).[2](targetElement).release().perform();
First, clickAndHold the source element, then moveToElement the target element before releasing to perform drag and drop.
Fill all three blanks to create a drag and drop test with proper setup and assertion.
WebElement source = driver.findElement(By.id("[1]")); WebElement target = driver.findElement(By.id("[2]")); new Actions(driver).[3](source, target).perform();
The source element has id draggable, the target has id droppable, and dragAndDrop performs the action.