Forum Discussion

mdadil191's avatar
mdadil191
New Contributor
13 years ago

Getting Garbage Value in "all items" and "selection" property of WinList:ListBox

We are getting garbage text in “all item” and “Selection” properties of object WinList:ListBox


The Snapshot is attached as "a"



  The Text Property is blank.


 I have tried getting the text present in the list box using GetROProperty”text”,”all Items” and “selection” but I am getting values as shown below.                                        


· I have also applied GetVisibleText  but by using that also I am not getting the correct data.


·  Applied the GetVisibleText and tried to write the data into Excel file then also I am getting the wrong data.


·  Have applied descriptive also by using below code.


·         If Window("…..").Window("……").WinList("ListBox").Exist Then


                Dim objCHild


                Set sobjCHild = description.Create


                SEt objCHild =  Window("………").Window("……….")'.WinList("ListBox")


                Set Mychildren = nothing


                set objChildren = objCHild.ChildObjects(Mychildren)


                intChildOBJECTs = objChildren.count


                                msgbox "Child count = "& intChildOBJECTs


                                msgbox objChildren(6).GetROProperty("all items")


        msgbox objChildren(25).GetROProperty("all items")


 

              For intCounter = 0 to  intChildOBJECTs - 1


                                strType =  objChildren(intCounter).GetROProperty("Value")


                                strName = objChildren(intCounter).GetROProperty("class name")


                                msgbox intCounter & " Name = " & strName & " Value = " & strType


                Next


                Else


                msgbox "Does not exist"


End if


Set  objCHild = NOThing


Set  objChildren = NOThing


Set  Mychildren = NOThing


Here also my efforts are gone to vain.


Please help please……..


Many thanks in Advance !!!

Adi

2 Replies

  • Hi,



    The code you've posted doesn't seem to be developed in TC. It uses a different object model and properties/methods which TC's object model doesn't support. Also, screenshots are showing something not related to TC at all.



    Can you clarify your request?
  • mdadil191's avatar
    mdadil191
    New Contributor

    Hi Jared ,


    Thank you for your reply.


    The above code is developed on QTP10, and the first two screenshots is showing the properties using object spy.The third one shows the msgbox with content taken by using property GetRoProperty(“all items”).


     


    Please let me know is this clarifies your question .


    Thanks,


    Adil