Forum Discussion

abpasha's avatar
abpasha
New Contributor
5 years ago
Solved

Unable to use TextObject method on TreeView object for desktop application developed in C#

Hi All,

I am facing issue in using the TextObject method on TreeView object.

The application is migrated from VB6 to C#. In VB6 version of the application I TextObject method is returning the object based on the associated text but the same method is unable find the object in C#.

 

Is there any specific reason for the same?

Is there any specific configuration required?

 

Regards,

ABPasha

  • abpasha did you find the solution? It seems like none of the suggested approaches helped. This means that a deeper investigation is required. The best next step is raising a Support Ticket.

    Please post the solution here when you have one! Thank you!

6 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    As it is specified in the documentation, .TextObject() method requires text to be drawn by the window procedure when it processes the WM_PAINT or WM_PRINTCLIENT message or by functions of the Direct2D library.

    I think that this is how VB6 works but C# uses some other technique to render the text on the screen.

     

    Considering that .Net applications are open to TestComplete by default, I would suggest to start from the investigation of the given TreeView object in the Object Browser and look for the properties/methods that can be used to identify and access the data you are looking for.

    If you fail with the above, you should ask developers for their recommendation for how the data can be found (what native methods of TreeView should be used).

     

    • abpasha's avatar
      abpasha
      New Contributor

      Thanks Alex for quick response. Will check and get back to you.

       

      Regards,

      ABu

  • Wamboo's avatar
    Wamboo
    Community Hero

    Hi,

     

    Also check if you have correctly set TextRecognition for this particular class to ON.

     

    It's in Tools -> Current Project Properties -> Open Applications -> Test Recognition

    • abpasha's avatar
      abpasha
      New Contributor

      Yes, the option is enabled, still getting that error.

      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        Thanks Wamboo and Alex! 

         

        abpasha did you manage to solve this? Please share your progress with us!