# Drag and Drop

{% hint style="info" %}
This feature is currently in Beta for Android Only.
{% endhint %}

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

<figure><img src="/files/bYkJXPEzd909fKVxrbuf" alt=""><figcaption><p>Example of dragging an Android widget on to the home screen</p></figcaption></figure>

### Use the dragAndDrop runScript step

<figure><img src="/files/io0STHZRvzClAvjGg3Vg" alt="" width="375"><figcaption></figcaption></figure>

Trigger using the [runScript](/creating-tests/commands/runflow-1.md) command.

Copy this snippet to try it your tests:

```
- longPressOn:
    point: '50%,38%'
- tapOn:
    text: 'Widgets'
- tapOn:
    text: 'Chrome'
- runScript:
    file: './moropo.js'
    env:
      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`)

{% hint style="info" %}
Need more parameters for your use case? Drop us a message, and we'll extend the API.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moropo.com/creating-tests/advanced-use-cases/drag-and-drop.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
