import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class DragAndDropDemo {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://dhtmlgoodies.com/submitted-scripts/i-google-like-drag-drop/");
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
WebElement source = driver.findElement(By.xpath("//div[@id='block-1']/h1"));
WebElement destination = driver.findElement(By.xpath("//div[@id='column-2']"));
Actions act = new Actions(driver);
act.dragAndDrop(source, destination).perform();
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class DragAndDropDemo {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://dhtmlgoodies.com/submitted-scripts/i-google-like-drag-drop/");
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
WebElement source = driver.findElement(By.xpath("//div[@id='block-1']/h1"));
WebElement destination = driver.findElement(By.xpath("//div[@id='column-2']"));
Actions act = new Actions(driver);
act.dragAndDrop(source, destination).perform();
}
}
No comments:
Post a Comment