Forum Discussion

HD's avatar
HD
Contributor
11 years ago
Solved

Namemapping nightmare

Hi,



I am new to Testcomplete and having trouble with namemapping. I am using Testcomplete to test a WPF based application. The issue is that UI on the application keeps changing, and each time I have to update the namemapp as well as the tests that use onscreen actions. This is a nightmare as it takes a lot of time, and most of my time is spend on updating namemapping and the tests.



1) Namemap is like a tree, so if something is added near the root then I need to remapp all the child nodes even when they did not change. There is no mechanism to copy paste the nodes or to insert a node in between the tree. Is there a workaround or feature to do this easily?



2) Also, even after updating the namemapping I need to update the refereneces in the tests and onscreen actions. Is there a better way to do it?



Is there a better alternative to namemapping or a better way to handle this scenario?
  • Forget name mapping and use small scripts that search your entire app for the object you need, sending as parameters the properties they have, for example (this works for me because i'm testing a webapp, but I think it works for anything):



    function clickObject(propName, propValue,depthOfSearch)

    {

        Sys.Process("yourApp").FindChild(propName,propValue,depthOfSearch).click(0,0);

    }



    Now you can use this for any action your object supports, use object spy to see all the details about the object you're looking for.



    This solves your issue because it always finds your object, unless their properties change, wich they shoudn't.



    Name mapping is only usable if your app will never change, otherwise you need to take a crash course on how to be able to configure it to work with wildcards and stuff....

21 Replies