Search code examples
pythonpywinauto

How can I move the focus on a Treeview.item with pywinauto?


[OBJECT] Treeview with several items. I want to click on an item that is visible only after I scrolldown. How can I move the focus on that Treeview.item with pywinauto ? Note: I want to try to getItemNumber and then with typeskeys(down) move to that item.

[CODE]
treeItem = systreeview.GetItem([u'A', u'thisItemShouldBeClicked'])
treeUtem.Click()

Solution

  • Use

    treeItem.EnsureVisible()
    

    It scrolls TreeView down to the item so that you can Click() or ClickInput().