package module15;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.WebDriverWait;
//http://code.google.com/p/selenium/wiki/AdvancedUserInteractions#Native_events_versus_synthetic_events
public class Dragging {
/**
* @param args
*/
public static void main(String[] args) {
FirefoxProfile profile = new FirefoxProfile();
profile.setEnableNativeEvents(true);
WebDriver driver = new FirefoxDriver(profile);
driver.get("http://jqueryui.com/draggable/");
// use below line your problem will be solved
driver.switchTo().frame(0);
WebElement obj = driver.findElement(By.xpath("//div[@id='draggable']"));
Actions act = new Actions(driver);
act.dragAndDropBy(obj, 50, 50).build().perform();
//act.clickAndHold(obj).dragAndDropBy(obj, 200, 200).build().perform();
driver.switchTo().defaultContent();
}
}