Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

methods click() and click_input() do the same thing #1382

Open
anerold opened this issue Mar 5, 2024 · 0 comments
Open

methods click() and click_input() do the same thing #1382

anerold opened this issue Mar 5, 2024 · 0 comments

Comments

@anerold
Copy link

anerold commented Mar 5, 2024

Expected Behavior

click() should send WM_* messages to the control and click_input() should simulate HW action. As stated in the documentation:

https://pywinauto.readthedocs.io/en/latest/code/pywinauto.base_wrapper.html#pywinauto.base_wrapper.BaseWrapper.click_input

https://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.hwndwrapper.html#pywinauto.controls.hwndwrapper.HwndWrapper.click

Actual Behavior

in the backgroud they both call mouse._perform_click_input(). So in the end they both do the same

Steps to Reproduce the Problem

  1. just locate any clickable element (e.g. button) in the App
  2. element.click_input()
  3. mouse.click(coords=(x, y))
  4. both 2. and 3. will have same result

Short Example of Code to Demonstrate the Problem

import pywinauto.mouse as mouse
from pywinauto.application import Application

app = Application(backend="uia").start("notepad.exe")
elem = app.window().child_window(title='File', control_type='MenuItem')
elem.click_input()
# or
coo = elem.rectangle().mid_point()
mouse.click(coords=(coo.x, coo.y))

Specifications

  • Pywinauto version: pywinauto==0.6.8
  • Python version and bitness: 3.11 64-bit
  • Platform and OS: Windows 10 x64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant