Go to site :
http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/draganddrop/defaultcs.aspx
Drag and drop the components (means drag location Brazil and drop to other component.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ActionsDragDrop { | |
public static void main(String[] args) throws InterruptedException { | |
// TODO Auto-generated method stub | |
WebDriver driver=new FirefoxDriver(); | |
driver.get("http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/draganddrop/defaultcs.aspx"); | |
Thread.sleep(4000); | |
Actions builder = new Actions(driver); | |
// get the source element | |
WebElement sour = driver.findElement(By.xpath("//*[@id='ctl00_ContentPlaceholder1_RadListBox1_i7']")); | |
// get the destination element path | |
WebElement dest = driver.findElement(By.xpath("//*[@id='ctl00_ContentPlaceholder1_RadListBox2']/div[2]")); | |
Thread.sleep(4000); | |
// using drag drop methods.. | |
// using drag and drop methods we can move item from location A to Location B | |
builder.dragAndDrop(sour, dest).perform(); | |
} | |
} |