Forum Discussion

witte's avatar
Occasional Contributor
12 years ago

FindAllChildren does not working correctly


I have to test our new Silverlight 5 software, which is an Out-Of-Browser application.

After starting the tool, I'd like to click every tab or register and then I have to found all Buttons within this page.

Here is my simple Testfunction:


function startTest(){

  var slLauncher_Proc = Sys["Process"]("sllauncher");

  var slcontrol = slLauncher_Proc["FindChild"]("ObjectIdentifier","silverlightControlHost", 8, true);

  var pageParentChilds = new Array();


  toolname = "ConfigurationTool Application";

  //get register names

  cPages = definePages["pagesConfig"];


  tool = slLauncher_Proc["FindChild"]("WndCaption",toolname, 5, true);


  register = slcontrol["FindChild"]("ObjectIdentifier", "ExtendedTabControl", 20, true);

  Log["Message"]("Anzahl der Register:" +itemsNumConfig);


  for(i=0; i<itemsNumConfig;i++){

      helper_references.createLogFolder("Register "+i);

      c = i+1;

      pagename = cPages["Page"+(c)]["Items"](1);

      helper_references.createLogFolder("Pagename: "+pagename);

      pageObj = register["FindChild"]("ObjectIdentifier",pagename+"*",100, true);

      pageParentChilds = new Array();      



        pageParent = pageObj["Parent"];

        Log["Message"]("Parent Object of this Page = "+pageParent["Name"]);


        Log["Message"]("pageParent clicked");



        pageParentChilds = pageParent["FindAllChildren"]("ClassName", "Button", 100, true);

        pageParentChilds = (new VBArray(pageParentChilds))["toArray"]();

        Log["Message"]("pageParent childs searched." );


          Log["Message"]("found: " +pageParentChilds["length"]);


          Log["Message"]("found nothing");



        Log["Warning"]("Page not found!");







The object from where the childs have to be searched is always the current tab (for example => ["UIAObject"]("TabItem", 6)).

I dont see any problem in code, normally it should work?! But it always find buttons from only one tab ( the first one or the last one)  and sometimes no buttons. In Object Tree all elements are displayed.

I thought it could be a problem of refreshing or timing. But both I've changed and it has no effect.

So, I have no solution for my problem and hope you can help me!....

Please have also a look to attached picture with the object Tree structure.



2 Replies

  • witte's avatar
    Occasional Contributor
    I am despairing with this problem....

    It seems to me that my object hasn't the correct elements.

    But when I check the name of object by Log message, it is correctly. But even if I search for all objects what ever object it is, not all childs found.

    I don't understand this behavior because I also used the method since TestComplete 8.

    The onliest difference is that I have another application, Silverlight 5 as Out-Of-Browser.

    What is wrong? Should I use another function or anythink other is needed? 
  • TanyaYatskovska's avatar
    SmartBear Alumni (Retired)



    This article contains requirements for testing out-of-browser Silverlight app. Are all of them met on your side?

    Also, to debug what is going wrong, I suggest that you save the current object tree before clicking the button on the tab and examine its structure. This may give you some clue.