Drag and Drop is not working in my selenium code below, can anyone help me?
package selenium;
import java.util.concurrent.TimeUnit;
import org.apache.log4j.Bas
You can surely do it using below code. Just ensure that your xpath
is correct or else you can't do it using any of the options.
WebElement from = driver.findElement(By.xpath("html/body/div[1]"));
WebElement to = driver.findElement(By.xpath("html/body/div[2]"));
Actions action1 = new Actions(driver);
action1.clickAndHold(from).moveToElement(to).release(from).build().perform();
Let me know in case of any issues but try this one it will work :)