1

I have a table object with one row in it. I want to click on the CheckBox inside this line, but all I could do was click on the line itself, but not on the CheckBox. Code:

app = Application().connect(title="Название окна программы")
window = app['Название окна программы']

table = window.child_window(control_type="Table", title="Название таблицы")

items = table.items()

for item in items:
    if 'CheckBox' in item.friendly_class_name():
        item.click_input()
        break

How do I click on the CheckBox to put a check mark there? pywinauto version == 0.6.8

7
  • 1
    Add param where="check" here: item.click_input(where="check") Commented Nov 9, 2024 at 15:59
  • Other examples are here: github.com/pywinauto/pywinauto/blob/master/pywinauto/unittests/… Commented Nov 9, 2024 at 18:03
  • @VasilyRyabov TypeError: BaseWrapper.click_input() got an unexpected keyword argument 'where' Commented Nov 11, 2024 at 8:14
  • Try Application(backend="uia"), but script could be re-written, because the UI elements hierarchy may look a bit different (more rich). By the way, control_type is more typically used for backend="uia", default backend "win32" typically needs class_name keyword. Commented Nov 12, 2024 at 6:06
  • @VasilyRyabov I use Application(backend="uia") specifically. I can't figure out exactly what the problem is. Maybe I have an incorrect version of pywinauto installed (although I doubt it), maybe there is some way to check this? Commented Nov 12, 2024 at 7:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.