Micro Focus QTP (UFT) Forums
How to get the names of all elements of directory (SAPGuiElement) - 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 Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: How to get the names of all elements of directory (SAPGuiElement) (/Thread-How-to-get-the-names-of-all-elements-of-directory-SAPGuiElement)



How to get the names of all elements of directory (SAPGuiElement) - nguyen4685 - 01-30-2017

[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


RE: How to get the names of all elements of directory (SAPGuiElement) - nguyen4685 - 02-03-2017

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