Skip to main content
Release the mouse button you pressed with mouseDown(). Call it on the element where the drag should end:

element.mouseUp()

Moves the mouse to the point where find() located the element, then releases the left button. Because the mouse moves before the release, the app sees a drag rather than a jump. It’s the same as element.click('mouseUp').
It takes no parameters.

Errors

Throws an ElementNotFoundError if find() didn’t locate the element. See click() for how to check found() first.

Release at coordinates

The client has no mouseUp() method. To release the button at a point on the screen, pass action: 'mouseUp' to testdriver.click():
Prefer element.mouseUp(), which keeps working when the layout or screen size changes.

Examples

Drop a file into an upload area

Resize a panel

Complete example

tests/drag-and-drop.test.mjs