package practise;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class Draganddrop {
public static void main(String[] args) {
WebDriver driver=new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get(url);
WebElement src=driver.findElement(By.xpath("//div/div[@id='column-3']"));//div[@id='column-3']
WebElement dest=driver.findElement(By.xpath("//h1[text()='Block 3']"));
Actions act=new Actions(driver);
//act.dragAndDrop(src, dest).perform();
act.moveToElement(src).clickAndHold().moveToElement(dest).release().build().perform();
}
}
Thanks,
Anand.