0

How to implement drag and drop using javascriptexecutor?

4
  • stackoverflow isa place o correct mistakes .noy say how to do too you !!! Commented Jun 16, 2017 at 10:01
  • new Actions(driver).dragAndDrop(source, target).build().perform(); is not working Commented Jun 16, 2017 at 10:03
  • stackoverflow.com/questions/19384710/… Commented Jun 16, 2017 at 10:04
  • Look at this. It might be of help. Commented Jun 16, 2017 at 10:05

1 Answer 1

1

Actions actions = new Actions(driver); actions.clickAndHold(element).moveToElement(targetElement).r‌​elease(element).perf‌​orm();

should work, it worked in my case.

Sign up to request clarification or add additional context in comments.

5 Comments

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.
@anshul Gupta. I am trying to drag and drop of li element in ul.
<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>
@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.
@anshulGupta Okay anshul. Have you ever tired with same? I am still not able to automate the use case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.