.click() element of control_type=Pane
See original GitHub issueI have an element:
{'class_name': 'WindowsForms10.Window.8.app.0.3b93019_r36_ad1', 'friendly_class_name': 'Pane', 'texts': [' On '], 'control_id': 328786, 'rectangle': <RECT L121, T476, R141, B496>, 'is_visible': True, 'is_enabled': True, 'control_count': 0, 'is_keyboard_focusable': True, 'has_keyboard_focus': False, 'automation_id': 'm_7b4cbcbae7174e47929ddd7339f80b0d'}
Control Identifiers: Pane - ' On ' (L751, T747, R771, B767) [' On ', 'Pane', ' On Pane'] child_window(title=" On ", auto_id="m_7b4cbcbae7174e47929ddd7339f80b0d", control_type="Pane")
Output from Inspect.exe:
- hwnd=0x00050452 32bit class=“WindowsForms10.Window.8.app.0.3b93019_r36_ad1”
- ControlType: UIA_PaneControlTypeId (0xC371)
- LocalizedControlType: “pane”
- Name: " On "
- ClassName: “WindowsForms10.Window.8.app.0.3b93019_r36_ad1”
- NativeWindowHandle: 0x50452
- IsOffscreen: false
- FrameworkId: “WinForm”
- ProviderDescription: “[pid:6960,hwnd:0x50452 Main:Nested [pid:1908,hwnd:0x50452 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]”
The element looks like a CheckBox, but raises AttributeError: Neither GUI element (wrapper) nor wrapper method 'click' were found (typo?) upon .click(), and raises NoPatternInterfaceError upon .invoke() and .select(). I believe this error is because it’s a Pane control_type.
.click_input() works fine, but I would prefer to not have the window and button visible.
I should also note that all of the above is identical with both ‘uia’ or ‘win32’ backends.
My question: is it possible to get .click() to work on this element?
Thanks in advance.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
It’s worth trying methods
.toggle()and.select(). Method.click()is an alias for.invoke()for pure buttons only. Otherwise use.click_input()method as a usual click by mouse.That’s good to know. I’ll mark as closed because I have a good solution. I plan to use .set_focus() and then .move_window() to ensure robust button clicking. Thanks for all the help.