How to Retreive Values from a SwfListView

625 views
Skip to first unread message

Raj

unread,
Aug 1, 2007, 3:48:03 PM8/1/07
to QTP - Mercury Quick Test Professional - Automated Software Testing
Hi,

My issue is related to Windows based .Net application. I have this
application which has a Table like view consisting data with in it in
terms of rows and columns except that it is identified as SwfListView.
I need to pull out the data ( text ) from the cells ( so far which is
what I address for understanding purpose though this is not a table )
and have to compare it with some fixed data.

Problem is I am unable to figure out how I can pull out the data. So
far I have tried the following:

Dim Item_count, Item_select
SwfWindow("DMS Admin").SwfWindow("Edit Admin").Activate
Item_count=SwfWindow("DMS Admin").SwfWindow("Edit
Admin").SwfListView("EditListView").GetItemsCount

msgbox Item_count

Problems are:

The Object is recognized as SwfListView i.e. this is of type List not
Table (SwfTable)
Also all the complete this is together considered as a List i.e. I
am unable to get individual value out there that is visible. I only
could do:


SwfWindow("DMS Admin").SwfWindow("Edit
Admin").SwfListView("EditListView").Select 0 --> This selects the
first row

msgbox SwfWindow("DMS Admin").SwfWindow("Edit
Admin").SwfListView("EditListView").GetSelection

msgbox SwfWindow("DMS Admin").SwfWindow("Edit
Admin").SwfListView("EditListView").GetContent

msgbox SwfWindow("DMS Admin").SwfWindow("Edit
Admin").SwfListView("EditListView").GetItem(0)


The above three messages just give me a blank message i.e. a blank
value.

However, when I have used:

msgbox SwfWindow("DMS Admin").SwfWindow("Edit
Admin").SwfListView("EditListView").GetVisibleText

I am getting the complete data that I see in the application. I had to
play around with the Left,Bottom,Right and Top parameters which gives
me some text output which is the last priority as it is just a lot of
work ( and wastage of time too ).

Can anyone tell me how I can get through this.

Thank you in advance.

Raj

vibhav srivastava

unread,
Aug 2, 2007, 4:36:16 AM8/2/07
to Mercu...@googlegroups.com
I Think You should try with GetROProperty Property

Set Obj = SwfWindow("DMS Admin").SwfWindow("Edit
Admin").SwfListView("EditListView")
msgbox obj.GetROProperty("Value")

It should work.
Thank You

Regards'
Vibhav Srivastava

Raj

unread,
Aug 2, 2007, 9:11:36 AM8/2/07
to QTP - Mercury Quick Test Professional - Automated Software Testing
Thank you Vaibhav,

However, I forgot to mention in my earlier. The properties of
abs_x, hwnd, nativeclass, regexpwndclass, window id, swftypename
remain same for all the rows (as to what I name so far) and properties
selection, text, all items, checked remain null. And it doesnot show
"Value" in it's property list (when using object spy). As SwfListView
isnot similar to SwfList wherein we can find the values for "Value",
"selection","All Items"....etc

Any quick help in this is very much appriciated.

Thanks again.


On Aug 2, 4:36 am, "vibhav srivastava" <vibhavksrivast...@gmail.com>
wrote:

> > Raj- Hide quoted text -
>
> - Show quoted text -

Raj

unread,
Aug 3, 2007, 3:34:50 PM8/3/07
to QTP - Mercury Quick Test Professional - Automated Software Testing
Thought of leaving a message. I found that GetSubItem works fine with
the above issue.

Thanks all.

Reply all
Reply to author
Forward
0 new messages