Skip to main content

Drag and drop element in window

Sophie avatar
Written by Sophie
Updated over 2 weeks ago

Definition and Usage

This command allows you to drag an element to a specified position or another element in a window. It simulates the mouse drag and drop action, which can be used for moving items, rearranging elements, or interacting with drag-and-drop interfaces in applications.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Element

Select or capture an element to operate on

-

Yes

Use the capture button to select the element you want to drag

Drag to

Specify whether to drag the element to a specified position or a specified element

To the target position, To the target element

Yes

-

X-coordinate

The horizontal coordinate of the target position

Numeric value

Yes (when "To the target position" is selected)

Press Ctrl+Alt to input coordinates manually

Y-coordinate

The vertical coordinate of the target position

Numeric value

Yes (when "To the target position" is selected)

Press Ctrl+Alt to input coordinates manually

Target element

Select or capture an element to operate on

-

Yes (when "To the target element" is selected)

Use the capture button to select the target element

Advanced settings

Parameter

Description

Possible Values

Required

Options / Notes

Wait after execution (s)

Wait for a specified number of seconds after the action is executed

Numeric value

No

Default: 1 second

Movement speed

Specify how fast the mouse moves

Instant, High speed, Medium speed, Low speed

No

Default: Medium speed

Element timeout (s)

Wait time for element to appear (seconds)

Numeric value

No

Default: 20 seconds

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

You can use variables in the coordinate fields by clicking on the {x} icon. This allows you to dynamically set the target position based on previously defined variables. When using variables, ensure they contain appropriate numeric values for the coordinates.


Notes

  • The element must be visible and interactive on the screen for the drag and drop operation to work correctly.

  • For precise positioning, you can use the coordinate system where (0,0) is at the top-left corner of the screen.

  • The "Current mouse position" information can help you determine the exact coordinates for your target position.

  • If the element cannot be found within the specified timeout period, the command will fail according to your error handling settings.

  • Different movement speeds can be useful for different scenarios: use faster speeds for efficiency and slower speeds when the target application needs more time to respond to the drag action.

Did this answer your question?