user2477308
user2477308

Reputation: 41

All possible ways for DragAndDrop

I got to know that we have different ways for performing DragAndDrop in Webdriver which i am not aware off,

Can any help me what are they and which one is the best approach.

Even same code for draganddrop is not working around all browser some times, does any have idea for this?

Thanks in Advance

Upvotes: 1

Views: 209

Answers (1)

Ajay
Ajay

Reputation: 395

Try this code

driver=new FirefoxDriver();
                 Actions act=new Actions(driver);
                 driver.navigate().to("http://dev.css-zibaldone.com/onwebdev/post/jquery-drag-and-drop.html");
                 driver.manage().timeouts().pageLoadTimeout(25,TimeUnit.SECONDS);
                 WebElement drag=driver.findElement(By.id("draggable"));
                 WebElement drop=driver.findElement(By.id("droppable"));


                 act.dragAndDrop(drag,drop).perform();

Upvotes: 1

Related Questions