package script;
import org.openqa.selenium.By;
import org.openqa.selenium.RenderedWebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.thoughtworks.selenium.SeleneseTestCase;
public class DragAndDrop extends SeleneseTestCase{
public static void main (String[] arg)
{
WebDriver driver = new FirefoxDriver();
WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver, "http://www.webreference.com/programming/javascript/mk/column2/");
driver.get("http://www.webreference.com/programming/javascript/mk/column2/");
selenium.windowFocus();
selenium.windowMaximize();
RenderedWebElement from = (RenderedWebElement) driver.findElement(By.xpath("html/body/div[5]/div[2]/fieldset[1]/div/div[1]/div[1]"));
RenderedWebElement to = (RenderedWebElement) driver.findElement(By.xpath("html/body/div[5]/div[2]/fieldset[1]/div/div[1]/div[2]"));
from.dragAndDropOn(to);
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.RenderedWebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.thoughtworks.selenium.SeleneseTestCase;
public class DragAndDrop extends SeleneseTestCase{
public static void main (String[] arg)
{
WebDriver driver = new FirefoxDriver();
WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver, "http://www.webreference.com/programming/javascript/mk/column2/");
driver.get("http://www.webreference.com/programming/javascript/mk/column2/");
selenium.windowFocus();
selenium.windowMaximize();
RenderedWebElement from = (RenderedWebElement) driver.findElement(By.xpath("html/body/div[5]/div[2]/fieldset[1]/div/div[1]/div[1]"));
RenderedWebElement to = (RenderedWebElement) driver.findElement(By.xpath("html/body/div[5]/div[2]/fieldset[1]/div/div[1]/div[2]"));
from.dragAndDropOn(to);
}
}
No comments:
Post a Comment