Micro Focus QTP (UFT) Forums

Full Version: intervw question faced in ness technologies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how to make sure that the items in a wintree are sorted al

thanks for every help
could you please try like below.

Code:
n=Window("My Computer").WinTreeView("SysTreeView32").GetROProperty("items count")
sorted = true

For i=0 To n-2 step 1
    before=Window("My Computer").WinTreeView("SysTreeView32").GetItem(i)
    after=Window("My Computer").WinTreeView("SysTreeView32").GetItem(i+1)

          If  before > after Then
            sorted = false
            Exit For
        End If

Next

msgbox(sorted)
Are you sure this will work?

Can you do a test run let us know your optput this below code?