Can't spy on CheckListBox with AutoIt

752 views Asked by At

I can't spy on CheckListBox object (I think Delphi) in a window frame with AutoIt. It can't see anything in the area. I need to get the list of items from the area and possibly select one the items.

I am using python and robotframework.

I also tried using ControlListView:

self.get_autoit().ControlListView("Setup - XXXXX", "Select the XXXX", "[CLASS:TNewCheckListBox; INSTANCE:1]", "GetText")

But it throws:

com_error: (-2147352561, 'Parameter not optional.', None, None)

The error seems to be an issue with pywinauto.

Anyway I can not get the list of items from this annoying object.

The result from autoit spy is in screenshot:

result from autoit spy

Can anyone please suggest a good way to access the list of items in this unidentified area?

I can see the inside items from inspect.exe:

from inspect.exe

1

There are 1 answers

1
Kumar Gaurav On BEST ANSWER

Please see the detailed answer from Vasily in the comments. However to summarize:

In the original question, I was trying to get the list of items from CheckListBox using pyautoit however as it was not working. So, as suggested by Vasily, I used pywinauto (another automation tool) in UIA mode and following worked for me:

self.Wizard = Application(backend="uia").connect(title = self.installerTitle) #connect the application
self.Wizard.InstallerDialog.TreeView.wait('visible', timeout=150) #wait for tree view to load
        items = self.Wizard.InstallerDialog.TreeView.children() #get the children of tree view
        for item in items:  #iterate through items, radio button in this case
            if item.window_text() == "item_name_to_select":
                item.click_input() #click radio button if the text is what we are looking for
                return
        print "no item found with name: item_name_to_select"

The most helpful trick was to use print_control_identifiers() method in pywinauto to get the identifiers of the control. Also the inspect.exe in uia mode helped in identifying the objects.