I am trying UI automation using PywinAuto Lib. When I am trying, Multiple UI elements are having same UI Attributes . Is there any way , we can alias and identify what we need.
ControlType: RadioButtonControl ClassName: RadioButton AutomationId: checkBox1 Rect: (805, 259, 855, 287) Name: Handle: 0x0(0) Depth: 7 CurrentIsSelected: True
ControlType: RadioButtonControl ClassName: RadioButton AutomationId: checkBox1 Rect: (858, 259, 908, 287) Name: Handle: 0x0(0) Depth: 7 CurrentIsSelected: False
As we have see , we are seeing same UI attributes for both the UI elements. One way of deal is, we can go back to UI development and change the things .
But is there any way we can do alias and identify .
selectButton = app1.Dialog.child_window(auto_id="checkBox1",control_type="RadioButton")
selectButton .click_input(button='left')
when we run , we are seeing this error .
pywinauto.findwindows.ElementAmbiguousError: There are 3 elements that match the criteria {'auto_id': 'checkBox1', 'control_type': 'RadioButton', 'top_level_only': False, 'parent': <uia_element_info.UIAElementInfo - 'Ui automation', Window, 339012>, 'backend': 'uia'}