November 2012
Intermediate to advanced
326 pages
6h 41m
English
Selenium WebDriver implements Selenium RC's dragAndDrop command using Actions class. As seen in earlier recipes the Actions class supports advanced user interactions such as firing various mouse and keyboard events. We can build simple or complex chains of events using this class.
In this recipe, we will use the Actions class to perform drag-and-drop operations.
Let's implement a test which will perform a drag-and-drop operation on a page using the Actions class.
@Test public void testDragDrop() { driver.get("http://dl.dropbox.com/u/55228056/DragDropDemo.html"); WebElement source = driver.findElement(By.id("draggable")); WebElement target = driver.findElement(By.id("droppable")); Actions builder ...Read now
Unlock full access