To do this we have to include using OpenQA.Selenium.Interactions name space
driver.Navigate().GoToUrl("http://developer.yahoo.com/yui/examples/dragdrop/dd-reorder.html");
IWebElement element = driver.FindElement(By.Id("li1_1"));
IWebElement target=driver.FindElement(By.Id("ul2"));
IWebElement target1 = driver.FindElement(By.Id("li2_1"));
new Actions(driver).DragAndDrop(element, target1).Build().Perform();
new Actions(driver).DragAndDropToOffset(target1, 75, 40).Build().Perform();
driver.Navigate().GoToUrl("http://developer.yahoo.com/yui/examples/dragdrop/dd-reorder.html");
IWebElement element = driver.FindElement(By.Id("li1_1"));
IWebElement target=driver.FindElement(By.Id("ul2"));
IWebElement target1 = driver.FindElement(By.Id("li2_1"));
new Actions(driver).DragAndDrop(element, target1).Build().Perform();
new Actions(driver).DragAndDropToOffset(target1, 75, 40).Build().Perform();
Thanks a Lot for Sharing this !!! That helped a lot ..
ReplyDelete