Drag and Drop

This feature is currently in Beta for Android Only.

Occasionally, you may need to long-press and drag an item to move it across the screen.

Use the dragAndDrop runScript step

Trigger using the runScript command.

Copy this snippet to try it your tests:

- longPressOn:
    point: '50%,38%'
- tapOn:
    text: 'Widgets'
- tapOn:
    text: 'Chrome'
- runScript:
    file: './moropo.js'
      command: 'dragAndDrop'
      above: 'Chrome search'
      end: '40%,40%'

Supported parameters

from - A text identifier from the app hierarchy. Moropo will drag from the center of this element.

above - Use instead of 'from'. This will select a point 120 pixels above the text identifier. This is useful for dragging an Android widget.

end - The drop location as a percentage-based coordinate (.e.g. 40%,40%).

duration - The number of milliseconds to drag action takes (defaults to 1000)

Need more parameters for your use case? Drop us a message, and we'll extend the API.

Last updated