1

HI I am working on this webdriver program with chrome browser. All are working fine except this drag and drop function.

It is not throwing me the error but it is still not executing the action. Can you help me with this. Thanks

  WebElement name = driver.findElement(By.xpath("xpath id")); 
  WebElement target = driver.findElement(By.xpath("xpath id"));
  Actions builder = new Actions(driver);
  Action dragAndDrop = builder.clickAndHold(name)
  .moveToElement(target)
  .release(target)
  .build();
   dragAndDrop.perform();

}

Ashwin Mohan
  • 11
  • 1
  • 3
  • If this is a HTML5 drag and drop, then I am afraid you won't be able to handle it directly using **Actions** class. You might have to use **Jquery** for that. Please take a look at these links: [http://stackoverflow.com/questions/24742539/unable-to-perform-html5-drag-and-drop-using-javascript-for-selenium-webdriver-te](http://stackoverflow.com/questions/24742539/unable-to-perform-html5-drag-and-drop-using-javascript-for-selenium-webdriver-te), [ISSUE LINK 1](https://code.google.com/p/selenium/issues/detail?id=6315), [ISSUE LINK 2](https://code.google.com/p/selenium/issues/detail?id=3604) – Subh Dec 11 '14 at 06:42

1 Answers1

0

Seems to be this Chrome bug (just run into this myself) https://code.google.com/p/chromedriver/issues/detail?id=841 The same code worked fine in Firefox.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567