pywinauto_recorder.player.drag_and_drop(element_path1, element_path2, duration=None, mode=MoveMode.linear, button=ButtonLocation.left, timeout=None)[source]

Drags and drops from element_path1 to element_path2.

  • element_path1 (Union[str, UIAWrapper, NewType()(UI_Coordinates, (float, float))]) – source element path

  • element_path2 (Union[str, UIAWrapper, NewType()(UI_Coordinates, (float, float))]) – destination element path

  • duration (Optional[float]) – duration in seconds of the mouse move (it doesn’t take into account the time it takes to find) (if duration is -1 the mouse cursor doesn’t move, it just sends WM_CLICK window message, useful for minimized or non-active window).

  • mode (Enum) – move mouse mode: MoveMode.linear, MoveMode.x_first, MoveMode.y_first

  • button (ButtonLocation) – mouse button: ButtonLocation.left, ButtonLocation.middle, ButtonLocation.right

  • timeout (Optional[float]) – period of time in seconds that will be allowed to find the element

Return type



Pywinauto wrapper found with element_path2


FailedSearch – if the element is not found