Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Objects inside WpfList
#1
Not Solved
Hello,

I'm using QTP 10.0 with .Net, WPF and Web Addins, on a workstation with windows XP SP3, and Framework .Net 3.5 SP1.

The application that I need to test has some WpfList with many columns in there.
My problem is that during my automation scripts, I select a line in a WpfList, and want to have access to strings inside EACH columns on selected lines. BUT with all properties i have tried, I only have access to first result column.

It is'nt enough for me.

Does anyone knows a solution?

Thanks in advance

P.S: You can see in attachment some picture about my problem.


Attached Files Image(s)
   
Reply
#2
Not Solved
Thanks for the detailed explanation. It helps. Can you post the code with which you were able to obtain the first value ?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
Thanks to you to be so quick.

In fact the code is very very simple:

Code:
stSelected = WpfWindow("GTIR").WpfList("selectionListView").GetSelection

MsgBox (stChaineTirSelected)

And it's the same with .GetItem(indexOfMyLine)...

thanks in advance
Reply
#4
Not Solved
Shinji458 -
sorry for the late reply. I dont know if you already got a solution for this, but if you have not, would you let me know what does,

wpflist().getcontent display ? and
wpflist().getvisibletext display ? and
wpflist().getitemscount display ?

Let me know the outcome.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Not Solved
Hello, thanks for your help.

Here is in attachment the asked results.

GetItemsCount give me the number of lines VISIBLE in my WpfList.
GetContent give me the first column of selected line.
GetVisibleText give me a huge string with all text visible in my WpfList. It could work this way, but with a very ugly code...

So, what do you think about all that?

thanks


Attached Files Image(s)
   
Reply
#6
Not Solved
I request you to upload a .Net Spy shot of the object.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#7
Not Solved
Here is in attachment.


Attached Files Image(s)
   
Reply
#8
Not Solved
Awesome Screenshot. This is how you have to supplement and it will help anyone.

shinji458 -

Anyways, that said, i am not going to say that the below is the solution. I have used my imagination to derieve this code and i hope this will help us to atleast move forward. Lets start and then we will tackle the rest,

Code:
firstitemcount = WpfList().Object.Items.Count
msgbox firstitemcount 'This should return 10...

seconditemcount = WpfList().Object.Items.Item(1).SubItems.Count
msgbox seconditemcount ' This should give you the total columns count

FrstcolItem = wpfList().Object.Items.Item(1).SubItems.Item(1).Text
msgbox FrstcolItem
Let me know what this returns ?? I have just written it based on the spyshot you sent. I hope we make some progress if we havent made already.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#9
Not Solved
thanks again for your help!

The first line of your solution is good, firstItemCount is effectively equals to 10.
But sadly, the second line returns me an error. It seems that the method "SubItems" doesn't exists for the object returned by ".Item(1)"

I have tried many combinations, all based on the idea of the "sub items of first item", without results. I can't find the object's method that can accomplish that. That leads me to a question: How do you find all these methods, like "Items" of "Object"? Auto-Completion doesn't work here, so i don't know what methods are available...

I hope my average english is understable... Wink


Attached Files Image(s)
   
Reply
#10
Not Solved
shinji458 -
As i said, my imagination is out of bounds. The inability to not have worked with a wpflist is causing time to get you a solution. Okay lets try this way,

Spy the object using the .Net spy. Look for Items property. I have seen your spyshot so i am sure it is there. Besides the Items property you will see Collection as the text. click on Collection and you will see a small box highlight on which you can click. Click on that and it will bring up another window within the spy. Can you screenshot that and upload it now pretty quick.

You have 5 mins from the time you read this post. I will be gone in the next 20 mins, and i want to resolve this before i leave.

The faster you are at it, the faster i am confident of a solution :- )

Never mind your english, you are better than many i have come across :-D
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Value in JavaEdit Inside JavaTable yonobev 9 12,963 11-08-2017, 11:12 PM
Last Post: lotos
  Get numbers inside all webelements in webtable and sort them pradeep537 1 2,809 08-04-2016, 01:24 AM
Last Post: Ankur
  Not able to click text inside the grid dropdown szkapoo 6 4,617 12-20-2014, 09:43 PM
Last Post: supputuri
  Read the HTTP response inside QTP script xcoder2 1 7,080 10-14-2013, 06:53 PM
Last Post: anil2u
  Values present inside a dropdown list. prempujaripati 1 2,908 03-05-2013, 12:20 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 8 Guest(s)