Micro Focus QTP (UFT) Forums

Full Version: How to get the names of all elements of directory (SAPGuiElement)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[attachment=1417]hello alls,

i want to ask if there is any possibility to get all the names (f.e. S-0065, S-0254 etc.) from the following directory (which should be a SAPGuiElement with type GuiSimpleContainer)

 SAPGuiSession("Session").SAPGuiWindow("Directorys on Server itpqdi30").SAPGuiElement("/1/3")

thanks for any help and responding

regards

EDIT:
maybe like this?

SAPGuiSession("Session").SAPGuiWindow("Directorys on Server itpqdi30").SAPGuiElement("/1/3").Object.SetFocus
Dim List : Set List = CreateObject("System.Collections.ArrayList")
List. Add SAPGuiSession("Session").SAPGuiWindow("Directorys on Server itpqdi30").SAPGuiElement("/1/3").ChildObjects
finally it works

f.e. i want to select "S-2540"

Set objects = SAPGuiSession("Session").SAPGuiWindow("Directorys on Server itpqdi30").ChildObjects
For i=0 To objects.Count-1
If objects.Item(i).Object.Text = "S-2540" Then
objects.Item(i).Object.SetFocus
End If
Next

I hope it could help someone