pywinauto_recorder.player.click

pywinauto_recorder.player.click(element_path=None, duration=None, mode=MoveMode.linear, button=ButtonLocation.left, click_count=1, timeout=None, wait_ready=True)[source]

Clicks on found element.

Example of code using the ‘click’ function:
from pywinauto_recorder.player import click, MoveMode

click("Calculator||Window->*->One||Button", mode=MoveMode.x_first, duration=4)
Parameters
  • element_path (Union[str, UIAWrapper, NewType()(UI_Coordinates, (float, float)), None]) – 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 (MoveMode) – move mouse mode: MoveMode.linear, MoveMode.x_first, MoveMode.y_first

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

  • click_count (int) – number of clicks

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

  • wait_ready (bool) – if True waits until the element is ready

Return type

UIAWrapper

Returns

Pywinauto wrapper of clicked element

Raises

FailedSearch – if the element is not found