Could not switch Tab Sheets on a window
See original GitHub issueI have following items of an application written in Delphi, printed with print_control_indentifiers and I want to select the tab with title=“Units”:
TfrmExportSetup - 'Export Setup' (L0, T0, R400, B600)
['Export SetupTfrmExportSetup', 'TfrmExportSetup', 'Export Setup']
child_window(title="Export Setup", class_name="TfrmExportSetup")
|
| TPageControl - '' (L6, T29, R394, B555)
| ['TPageControl', 'pnlExportActive1TPageControl']
| child_window(class_name="TPageControl")
| |
| | TTabSheet - 'Maintenance' (L10, T53, R390, B551)
| | ['MaintenanceTTabSheet', 'Maintenance', 'TTabSheet', 'TTabSheet0', 'TTabSheet1']
| | child_window(title="Maintenance", class_name="TTabSheet")
| |
| | TTabSheet - 'Units' (L10, T53, R390, B551)
| | ['UnitsTTabSheet', 'TTabSheet3', 'Units']
| | child_window(title="Units", class_name="TTabSheet")
I tried different methods and none works. Some of the failures:
1.
Code:
self.export.child_window(class_name="TPageControl").menu_select("Units")
Error:
pywinauto.controls.menuwrapper.MenuInaccessible
2.
Code:
page_control = self.export.child_window(class_name="TPageControl")
page_control.child_window(title="Units", class_name="TTabSheet").click_input()
Error:
pywinauto.findwindows.ElementNotFoundError: {'title': 'Units', 'class_name': 'TTabSheet', 'top_level_only': False, 'parent': <win32_element_info.HwndElementInfo - '', TPageControl, 3742488>, 'backend': 'win32'}
3.
Code:
self.export.child_window(class_name="TPageControl").menu_bar_click_input("Units", self.app)
Error:
AttributeError: Neither GUI element (wrapper) nor wrapper method 'menu_bar_click_input' were found (typo?)
4.
Code:
page_control = self.export.child_window(class_name="TPageControl")
tab_list = page_control.descendants(class_name="TTabSheet")
tab_menu = tab_list[2]
print(tab_menu)
tab_menu.click_input()
Output:
It prints: hwndwrapper.HwndWrapper - 'Units', TTabSheet
But clicks on center on the window, not on the Units tab
I’ve added screenshots with the TPageControl and Units elements highlighted by Inspect.exe I’ve struggled a lot with this and couldn’t find the issue… Thanks in the advance for the help!

Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Unable to switch sheets in Excel - Microsoft Community
Unable to switch sheets in Excel. Hi, I recently bought an Asus Zenbook and my PgDn button is together with my down arrow...
Read more >Can't move tabs, can't click on different windows open in ...
About a month or so ago I noticed I was no longer able to click and drag tabs I have opened in Google...
Read more >Why can't I switch between workbooks in Excel 2010 using ...
I found the answer on another site,. In Excel Options -> Advanced -> Display -> Uncheck "Show all windows in the Taskbar",; Click...
Read more >ALT TAB not Working: Diagnose & Fix in 7 Easy Steps
Alt-Tab not switching in Windows 10 – Several users reported that Alt-Tab doesn't switch windows on their Windows 10 PC. This can be...
Read more >Fix Alt + Tab not toggle/working with Excel in Windows 10
No matter you have opened multiple Excel files and other program in Windows 10, pressing Alt+ Tab keys only swaps between just two...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Issue solved! If anyone else has this problem I managed to find the solution by using TabControlWrapper. The solution that works:
Hi, do you know what do I need to change to get TabControlWrapper working for me? My goal is to paste “text” word in a specific tab of MobaXterm app.