Ask a Question

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

SOLVED
abpasha
New Contributor

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

6 REPLIES 6
AlexKaras
Champion Level 2

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).

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
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

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

 

Regards,

ABu

abpasha
New Contributor

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

sonya_m
SmartBear Alumni (Retired)

Thanks Wamboo and Alex! 

 

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


Sonya Mihaljova
Community and Education Specialist

sonya_m
SmartBear Alumni (Retired)

@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!


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: