How to implement drag and drop using javascriptexecutor?
-
stackoverflow isa place o correct mistakes .noy say how to do too you !!!Omid Reza Heidari– Omid Reza Heidari2017-06-16 10:01:23 +00:00Commented Jun 16, 2017 at 10:01
-
new Actions(driver).dragAndDrop(source, target).build().perform(); is not workingpragapraga– pragapraga2017-06-16 10:03:38 +00:00Commented Jun 16, 2017 at 10:03
-
stackoverflow.com/questions/19384710/…Abhinav– Abhinav2017-06-16 10:04:42 +00:00Commented Jun 16, 2017 at 10:04
-
Look at this. It might be of help.Abhinav– Abhinav2017-06-16 10:05:01 +00:00Commented Jun 16, 2017 at 10:05
Add a comment
|
1 Answer
Actions actions = new Actions(driver); actions.clickAndHold(element).moveToElement(targetElement).release(element).perform();
should work, it worked in my case.
5 Comments
demouser123
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.
pragapraga
@anshul Gupta. I am trying to drag and drop of li element in ul.
pragapraga
<div _ngcontent-vpq-9="" class="panel-body columnBody" dnd-droppable="" dnd-sortable-container="" draggable="false"> <ul _ngcontent-vpq-9="" class="list-group columnContent"> <!--template bindings={}--><li _ngcontent-vpq-9="" class="list-group-item columnContent" dnd-droppable="" dnd-sortable="" draggable="true">Custodian Name <div _ngcontent-vpq-9=""> <div _ngcontent-vpq-9="" class="closeList glyphicon glyphicon-minus-sign"> </div> </div>
anshul Gupta
@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.
pragapraga
@anshulGupta Okay anshul. Have you ever tired with same? I am still not able to automate the use case.