Skip to main content

dragAndDrop

Drags the first element over second or drags an element to an offset (or distance) of given x, y.

dragAndDrop(firstElemId, secondElemId)
# Or
dragAndDrop(elemId, x, y)

Parameters#

  • firstElemId: Element needs to be dragged
  • secondElemId: Element that is the drag target
  • elemId: Element needs to be dragged
  • x: A number. Offset in x axis in pixels, can be negative.
  • y: A number. Offset in y axis in pixels, can be negative.

Returns#

  • No value

Example#

dragAndDrop(findElement('block', by.testId), 200, -50)# drags element 200px to the right and 50px up