How to implement drag and drop using javascriptexecutor?
Asked
Active
Viewed 3,420 times
0
-
stackoverflow isa place o correct mistakes .noy say how to do too you !!! – Omid Reza Heidari Jun 16 '17 at 10:01
-
new Actions(driver).dragAndDrop(source, target).build().perform(); is not working – pragapraga Jun 16 '17 at 10:03
-
https://stackoverflow.com/questions/19384710/javascript-workaround-for-drag-and-drop-in-selenium-webdriver – Abhinav Jun 16 '17 at 10:04
-
Look at this. It might be of help. – Abhinav Jun 16 '17 at 10:05
1 Answers
1
Actions actions = new Actions(driver); actions.clickAndHold(element).moveToElement(targetElement).release(element).perform();
should work, it worked in my case.

anshul Gupta
- 1,182
- 8
- 17
-
Please format your code and do not add one line code as an answer. Please add your explanation along with the code, as to why this would solve OP's issue. – demouser123 Jun 19 '17 at 11:55
-
-
-
@pRaGaDeEsWaRaN not sure for li elements in ul. Try to provide more details in the questions initially. I was under the impression of normal drop down case. – anshul Gupta Jun 19 '17 at 13:27
-
@anshulGupta Okay anshul. Have you ever tired with same? I am still not able to automate the use case. – pragapraga Jun 21 '17 at 12:08