Forum Discussion

appunu's avatar
appunu
Occasional Contributor
14 years ago

Problem in accessing the listcontrol items

Hello,

          I am working with a tool which uses ListCtrl . The list ctrl displays the images. When i try to record the event in the listCtrl TC selects the item only by Co-Ordinates. Is there any methods other than co-ordinates and i want to access each and every element in the list control to get the image from it. The problem here is  that ObjectBrowser identifies as a single element



Sys.Process("XXX").Window("wxWindowClass", "XXX: XX", 1).Window("wxWindowClassNR", "panel", 1).Window("_wx_SysTabCtl32", "", 1).Window("wxWindowClassNR", "Workbench", 3).Window("wxWindowClassNR", "WorkbenchSplitterWindow", 1).Window("wxWindowClassNR", "WorkbenchSplitterWindow", 2).Window("wxWindowClass", "WorkbenchPanel", 2).Window("wxWindowClassNR", "panel", 1).Window("wxWindowClassNR", "panel", 1).Window("wxWindowClassNR", "ListCtrl", 1)  

7 Replies


  • Hello Murali,





    As far as I understand, you are working with a C++ application that uses the wxWidgets library. Even if these controls are compatible with the supported Win32 controls, they all have the 'wxWindowClassNR' window class which makes differentiation of control types impossible.





    In this case, I can suggest that you make use of the Text Recognition feature. Probably, this feature will expose separate items in the list and some other controls. Please find information on this feature in the Using Text Recognition Technology help topic.
  • appunu's avatar
    appunu
    Occasional Contributor
    Hi David,

                Ty for your reply. What you said was exactly true. Application created in C++ with WXwidgets. Still am facing the same problem after using the Text Recognition. They have used tree structures inside the ListCtrl with an arrowtip for each node. The TextObjects found in the list control are just the column names of the list control Eg : Name, format, Etc in the attachment. I need to verify the inner contents of the list control. How to get the inner text for each node in the list control. ? Thanx in advance :)

  • Hi Murali,





    In this case, the only solution I can suggest is working with the control with keyboard shortcuts. The main idea is that there are shortcuts for moving the cursor to the top level cell (e.g. Ctrl-Home or something like that), shortcuts for moving the cursor within the cells of the list control (e.g. Right and Down), shortcuts for starting and finishing editing of the cell under the cursor (e.g. Space and Enter), and a shortcut for copying the content of the current cell to the clipboard (Ctrl-C). You can access the content of the clipboard using the Sys.Clipboard property.





    I hope that you will find this information useful.
  • appunu's avatar
    appunu
    Occasional Contributor
    Hi David,

                  I worked last night and could able to find the text in the listcontrols using the TextObject calls. The only thing am stuck up with is the tree structure. I cant able to find the symbol using the TextObject, i know Obviously it wont find. Is there any thing i can do to press that button without using the co-ordinates ?



    Sys.Process("XXX", 2).Window("wxWindowClass", "XXX", 1).Window("wxWindowClassNR", "panel", 1).Window("_wx_SysTabCtl32", "", 1).Window("wxWindowClassNR", "Workbench", 3).Window("wxWindowClassNR", "WorkbenchSplitterWindow", 1).Window("wxWindowClassNR", "WorkbenchSplitterWindow", 2).Window("wxWindowClass", "WorkbenchPanel", 1).Window("wxWindowClassNR", "panel", 1).Window("wxWindowClassNR", "panel", 1).Window("wxWindowClassNR", "ListCtrl", 1).TextObject("sample", 3).DblClick() 





    And one more thing ,the auto code complete option is not coming some times , may i know that why? Eg : in the above script  after  TextObject("sample", 3)    when i use a period , sometimes the autofill comes and sometimes it doesnt. Thanx in advance :)

  • Hi Murali,





    The only thing am stuck up with is the tree structure. I cant able to find the symbol using the TextObject, i know Obviously it wont find. Is there any thing i can do to press that button without using the co-ordinates ?
    I am not sure that I understand correctly what you want to do. If you need to just click the text found by TestComplete as a TextObject object, you can just click this object as in the script you posted: TextObject("sample", 3).DblClick(). All the parameters of the DblClick method are optional and if you omit them, TestComplete will click to the central point of the object.





    And one more thing ,the auto code complete option is not coming some times , may i know that why?
    TestComplete shows a Code Completion window if it can parse the script, get the full name of the actual object and if this object exists or the Code Completion information on this object is saved in the Name Mapping file. Most probably, if the Code Completion window is not invoked in your case, TestComplete just cannot get the full name of the object you are working with.
  • appunu's avatar
    appunu
    Occasional Contributor
    Hi David,

    I just used the double click on the Text object to check whether i can perform any actions on the text object. But basically i want to traverse inside the list ctrl to get all the text present in the listctrl. I was not able to do that. My whole application is made up of this ListCtrl. I tried probing the key strokes for expanding the tree structure which actually worked, but as you said the short cut keys to access the cell didn work out.







    Regards

    Murali

  • Hi Murali,





    TestComplete can work with wxWidgets applications compiled with Visual C++ as with Open applications. This means that you can access native methods and properties object such applications' objects from TestComplete tests. Utilizing this possibility, you can try to find a way to work with objects in your application at a low level. Please find more information on this possibility in the wxWidgets Visual C++ Applications Support help topic.