Problem with datePicker
See original GitHub issueIn the application I need to click through with pywinauto, I have the Date Picker, which looks in the interface just like drop down box, which is empty on default, when you click the drop-down arrow, then calendar is showing up and you can select the date.
The controls detected by pywinauto look like this:
| | | | | | Pane - 'gcDateAndTime' (L230, T239, R615, B425)
| | | | | | ['gcDateAndTime', 'gcDateAndTimePane', 'Pane19']
| | | | | | child_window(title="gcDateAndTime", auto_id="gcDateAndTime", control_type="Pane")
| | | | | | |
| | | | | | | Pane - '' (L232, T260, R613, B423)
| | | | | | | ['10', 'Pane20']
| | | | | | | child_window(auto_id="searchDateAndTimeControl1", control_type="Pane")
| | | | | | | |
| | | | | | | | Pane - '' (L417, T279, R502, B299)
| | | | | | | | ['11', 'Pane21']
| | | | | | | | child_window(auto_id="datePickerTo", control_type="Pane")
| | | | | | | | |
| | | | | | | | | Pane - '' (L421, T282, R482, B296)
| | | | | | | | | ['12', 'Pane22']
| | | | | | | | | child_window(auto_id="4720152", control_type="Pane")
| | | | | | | | |
| | | | | | | | | Custom - '' (L421, T282, R482, B296)
| | | | | | | | | ['13', 'Custom29']
| | | | | | | |
| | | | | | | | Pane - '' (L320, T279, R405, B299)
| | | | | | | | ['14', 'Pane23']
| | | | | | | | child_window(auto_id="datePickerFrom", control_type="Pane")
| | | | | | | | |
| | | | | | | | | Pane - '' (L324, T282, R385, B296)
| | | | | | | | | ['15', 'Pane24']
| | | | | | | | | child_window(auto_id="5112538", control_type="Pane")
| | | | | | | | |
| | | | | | | | | Custom - '' (L324, T282, R385, B296)
| | | | | | | | | ['16', 'Custom30']`
Also in inspect.exe it looks strange for me. All 3 of the components (for example datePickerFrom and his children), have LegacyAccesible.Name and LegacyAccessible.Value set on “Friday, August 17, 2018” (today), and all of them have role “drop down”, and state “focused,focusable”. Poping up the Calendar doesn’t seem to be noticed by inspect.exe. When I set the date, the values and names are changed for the components.
Is it normal that it looks like this, or it seems like a problem with access to the component? I am newbie to pywinauto, but I feel like some components are missing here. I tried to use methods click/click_input/invoke/set_text on these components (datePickerFrom/To and their children), but nothing works. Is it possible to select the date with pywinauto in this case?
I’m using backend=“uia”, pywinauto ver.0.6.5, python 3.7.0 Please advice me something.
Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
Hello, sorry to comment on this closed issue, i was struggling with this same problem and successfully tried this method. So just wanted to say that re-using win32 backend worked for me in the end.
Looks like
DateTimePickerWrapperis not implemented in UIA backend. And this particular control is detected as Pane anyway. But if this control hasNativeWindowHandleproperty inInspect.exe, it’s possible to re-use wrapper from “win32” backend (at least try this). This should look so: