Micro Focus QTP (UFT) Forums
How to identify controls embedded within WinListView cells - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to identify controls embedded within WinListView cells (/Thread-How-to-identify-controls-embedded-within-WinListView-cells)



How to identify controls embedded within WinListView cells - Devesh Thakur - 04-05-2018

I'm automating tests for a desktop application on Windows platform.
In a WinListView control which is used to display a multi-valued list(Each row in the list has four columns in it). After hovering on each row to select it, when mouse click operation is performed on any of the four cells the respective control in that cell shows up(an editbox or a dropdown list)
It seems that the developers have embedded temporary WinEdit and WinComboBox controls in the cells of each row which makes it difficult to use Object spy on them. I succeeded in getting object spy to work on those by holding control key, but the properties of those objects are not unique, for instance ComboBox in the third cell in different rows has the same properties.Posting ObjectSpy results here.

Quote:
Code:
**ComboBox in Row 1 Cell 3**
"Class Name:=WinComboBox",
"abs_x:=1041",
"abs_y:=551",
"all items:=Hours\nMinutes",
"attached text:=",
"enabled:=True",
"focused:=True",
"height:=21",
"hwnd:=7602202",
"items count:=2",
"nativeclass:=ComboBox",
"object class:=ComboBox",
"regexpwndclass:=ComboBox",
"regexpwndtitle:=Minutes",
"rightaligned:=False",
"righttoleftlayout:=False",
"righttoleftreading:=False",
"selection:=Minutes",
"text:=Minutes",
"visible:=True",
"width:=90",
"window id:=7988488",
"windowextendedstyle:=0",
"windowstyle:=1342177987",
"x:=354",
"y:=257"

Code:
**ComboBox in Row 5 cell 3**
"Class Name:=WinComboBox",
"abs_x:=1041",
"abs_y:=619",
"all items:=Hours\nMinutes",
"attached text:=",
"enabled:=True",
"focused:=True",
"height:=21",
"hwnd:=11601852",
"items count:=2",
"nativeclass:=ComboBox",
"object class:=ComboBox",
"regexpwndclass:=ComboBox",
"regexpwndtitle:=Minutes",
"rightaligned:=False",
"righttoleftlayout:=False",
"righttoleftreading:=False",
"selection:=Minutes",
"text:=Minutes",
"visible:=True",
"width:=90",
"window id:=7988488",
"windowextendedstyle:=0",
"windowstyle:=1342177987",
"x:=354",
"y:=325"

I have tried selecting rows using WinListView.GetItem but that gives hold of the first cell only which is an editbox and it works. For the remaining three columns I can't find any workaround. I have tried performing clicks using WinListView.GetItem().Select operation providing offset in pixels to click on each cell but that doesn't activates the embedded controls although I see the mouse moving and performing clicks when the test runs.
Record and play didn't provide much insight either as the play operation doesn't replicate the actions successfully every time and uses same and generic names for actions on cells of different rows.

Code:
WinListView("WinListView Name").WinEdit("Edit").Set "20"
DialogObject.WinComboBox("ComboBox").Select "Hours"



RE: How to identify controls embedded within WinListView cells - Ankur - 04-06-2018

At times it is difficult to get an answer without the app infront. However for the start, you may want to try options under Select Tools > Options > GUI Testing tab > Windows Applications 
[attachment=1441]

and under Select Tools > Options > GUI Testing tab > Windows Applications >  Advanced
[attachment=1442]


RE: How to identify controls embedded within WinListView cells - Devesh Thakur - 04-09-2018

Ankur _> At times it is difficult to get an answer without the app infront. However for the start, you may want to try options under Select Tools > Options > GUI Testing tab > Windows Applications 


and under Select Tools > Options > GUI Testing tab > Windows Applications >  Advanced


[attachment=1444]

[attachment=1443]

Hers are some screenshots.


RE: How to identify controls embedded within WinListView cells - Ankur - 04-09-2018

Please upload these images as attachments and then click "Insert Into Post"


RE: How to identify controls embedded within WinListView cells - Devesh Thakur - 04-11-2018

(04-09-2018, 07:01 PM)Ankur Wrote: Please upload these images as attachments and then click "Insert Into Post"

Please Check If these images help.


RE: How to identify controls embedded within WinListView cells - Devesh Thakur - 04-19-2018

(04-09-2018, 07:01 PM)Ankur Wrote: Please upload these images as attachments and then click "Insert Into Post"

I've uploaded the images as attachments, please check.