Forum Discussion

MrDysprosium's avatar
MrDysprosium
Contributor
7 years ago

Check for an object on dynamically spawning windows.

So, finding a child object via `FindChildEx()` is simple enough, but how can it be used dynamically?

I have a program that has a configurable number of tabs, each tab is named uniquely and can change each time the software is run. If I simply search for a child object from the highest level down there is a possibility of finding that object on a different tab than the one I am currently viewing.

So, without knowing the name of a tab ahead of time, how can I use FindChildEx() on it in code?

3 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    First, you need to find a tab which you want access the object from. Then you can use that found tab object to access your other objects so that you will not go wrong.

     

    for ex;

     

    var tabObject = tappedPaneParent.FindChildEx("WndCaption","uniqueTabname",5,true,10000);//to get the unique named tab object from its parent

    var txtname = tabObject..FindChildEx("WndCaption","textBox1",1,true,10000);//to get the object from idenfied tab object.

  • NisHera's avatar
    NisHera
    Valued Contributor

    Also you can use extended find in name mapping.

    In this way your scrips are more cleaner and name mapping would do the job 

     

    please refer this link

    please read the section of  Dynamic Object Hierarchy