Forum Discussion

farhanahmed's avatar
farhanahmed
Contributor
14 years ago

Whats the difference between wText and Text?

hi

can any one tell me whats the difference between MyControl.wText and MyControl.Text ?

both of them same or there is any difference in usages?

Best Regards
  • Hi,



    wText is a property added by TestComplete, whereas Text is most likely a native property defined in the component itself.



    The difference is that the native Text property returns a native string object, e.g. .NET System.String. This string object may not be directly compatible with the string data type used in TestComplete keyword tests and scripts, so additional conversion operations may be needed. TestComplete's wText property, in its turn, uses a compatible string type so it can be manipulated directly.



    Besides that, TestComplete's wText performs some behind-the-scenes operations like checking the maximum string length when setting the text and logging a warning if the text is longer than allowed.



    Generally, you should use TestComplete test object properties when possible, and only use native properties if there're no TestComplete-provided analogs.