Forum Discussion

kevinkleint's avatar
kevinkleint
Contributor
15 years ago

Generic way of referencing 3rd party controls?

Hi,



Is there some generic way to find a reference to 3rd party controls that TestComplete doesn't support? I contacted our vendor and they said that they are not using any of your supported controls, but the controls that they ARE using are "proprietary" and cannot be shared.



As it stands right now, when I try to access the 3rd party list control, it does not refer to any list items, but I am getting "LBS_HASSTRINGS errors".



I'm using JScript.



Thx.



Kevin

4 Replies


  • Hi Kevin,





    It looks as if you are working with a control which represents data in the tabular form. If so, try the following:

    1. Double-click your project's node in the Project Explorer panel.

    2. Select the "Open Applications | Text Recognition" section of project properties.

    3. Click the Add button and specify WndClass of the control you are using (e.g. "ListBox") in the newly created item.

    4. Save the changes and check how the control is recognized now - you should see a separate "TextObject" item for each table cell.


  • Hi Allen,



    I've added the Listbox and ListItem controls to the Text Recognition, but to no avail. I am able to map to the Listbox, but the individual items in the list box are not accessible. The farthest I've been able to get to is the ListItem("??") - which is a weird way to read a control, but that's what I see.



    What I'm trying to do is test for an Active Status (image3).



    If there is no "easy" way to access these controls, is there some way to get a reference using JScript?



    Thanks,



    Kevin

  • Hi Kevin,





    If the Item property does not help, try examining native methods and properties of the object returned by the NativeObject property. Also, check the Methods tab of the ListBox object - it's possible that you'll be able to find some native methods which can be used to retrieve specific cell values.


  • reddy_db's avatar
    reddy_db
    New Contributor
    Hi,

    I have come across the same problem, and found solution to retrieve text from the owner-drawn ListBox controls:

    Below code is in VB Script : 

    ==================================

    set lBox = <ListBox object>

    count = lBox.wItemCount




    for i = 1 to count - 1


            lBox.DblClickItem(i)


            msgbox lBox.Edit.wSelection


    Next



    ==================================



    The above code will give you the text of each cell item.



    -Bhaskar