0

With protractor and firefox, I want to drag and drop an element with this:

const plot0 = element(by.id('AnalyseErrors'));
browser.actions().dragAndDrop(plot0, {x: 70, y: 70}).mouseDown().mouseMove({x: 10, y: 10})
    .mouseMove({x: 10, y: 10})
    .mouseMove({x: 10, y: 10})
    .mouseMove({x: 10, y: 10})
    .mouseMove({x: 10, y: 10})
    .perform();

I also try

browser.actions().dragAndDrop(plot0, {x: 70, y: 70}).perform();

I even try:

const element0 = element(by.id('AnalyseErrors')).getWebElement(); // This is the element to move
const element1 = element(by.css('body > app-root > div > ng-component > div > div.editor-container')).getWebElement(); // This is the content zone to drop the element

browser.actions()
  .dragAndDrop(element0, element1).
  perform();

The element is located on a side bar, i have to select him and, with the mouse , dragg and drop to a content zone.

Unfortaly doesn't work. - Failed: POST /session/875dc0ad-4d29-4bff-9efc-98e4d05379f4/moveto did not match a known command

Do you know why?

Batajus
  • 5,831
  • 3
  • 25
  • 38
Carlos Rodrigues
  • 127
  • 1
  • 2
  • 11
  • Not sure why it is saying `moveto` is not a known command but I do know that there is a known issue with drag and drop and Chrome. Try using [html-dnd](https://github.com/html-dnd/html-dnd) instead. It works very well. – tehbeardedone Aug 14 '18 at 14:36
  • It a possible duplicate of [How to simulate a drag and drop action in protractor in angular2?](https://stackoverflow.com/q/40607833/4661771) – Batajus Aug 20 '18 at 20:32

0 Answers0