Forum Discussion

Aerlock's avatar
Aerlock
Occasional Contributor
9 years ago
Solved

Getting a list of unmapped items on a web page?

Hi all, I'm new to Test Complete and am trying to work with my Developmnet team to get our app into shape to fully support automation with Test Complete. We've run into several issues with similar or...
  • TanyaYatskovska's avatar
    TanyaYatskovska
    9 years ago

    Hi,

     

    You can iterate through all children objects of your page and check for the MappedName property. If the property contains a value, the object was mapped. Here is a sample code for this:

    function CheckMappedName(obj)
    {
       var chCount = obj.ChildCount;
       if (chCount == 0) return;
       for (i = 0 ; i < chCount ; i++)
       {
        if (obj.Child(i).MappedName == "")
        {
          Log.Message(obj.Child(i).FullName + " isn't mapped");
        }
        CheckMappedName(obj.Child(i));
       }
          
    }
    
    function Test()
    {
      var obj = Sys.Process("notepad"); // specify your object here
      CheckMappedName(obj); 
    }