Micro Focus QTP (UFT) Forums
WinList Behavior - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: WinList Behavior (/Thread-WinList-Behavior)



WinList Behavior - marse91782 - 11-24-2016

We are automating a Small Talk application and trying to launch a window by clicking an item from a WinList. Unfortunately, it is not activating the item we are expected to to launch. Is there another way to know the index of the item we need to double click or activate?

Item List Count: 13
Index of item to select (zero-based index): 11
Actual index selected: 5

Code snippet:

ItemListCount = Window("window").WinList("list").GetItemsCount

For i = 0 To ItemListCount - 1
    Text = Window("window").WinList("list").GetItem(i)
    If Strcomp(Text, "Templates") = 0 Then
        Window("window").WinList("list").Activate i
        Exit For
    End if
Next