Forum Discussion

RobertPeip's avatar
RobertPeip
New Contributor
5 years ago

Cast Object as WPF Object

Hi,   i'm trying to use Testcomplete standard functions with an object received directly from a function call to a WPF/.net application on a request, rather than going through the usual Namemapping...
  • AlexKaras's avatar
    5 years ago

    Hi Robert,

     

    is there any possibility to tell Testcomplete, that "obj" is a WPFButton

    No, this is not possible.

    If I got it right, .GetControl() is a method of the tested application that returns native .Net object. WPFButton (and others a-like) is TestComplete's wrapper over the .Net object identified via the means provided by TestComplete.

    10 seconds for every control seems weird and my guess is that you should optimize either your NameMapping/Aliases or the way how .FindChild is used. (For example, the search that starts at application level and searches for the object that is too deep in the wide objects tree might be slow. But the preliminary search for one or several intermediate parent containers for the same object might speed up the search quite significantly.)