Forum Discussion

Re: getting objects via recurssion

 

Dear tristaanogre,

 

I have understood the concept of Aliasse but acutally what I am trying to do is,

In each bar item, there is a grid and I would like to test in that grid.

the grid mapping examples like this:

Aliases.process().VCLObject(txt1).VCLObject(text2).VCLObject(text3)...VCLObj(text4).VCLObject(text5)

Aliases.Process().VCLObject(txt1).VCLObject(text2).VCLObject(text10)...VCLObj(text4).VCLObject(text5)

Aliases.Process().VCLObject(txt1).VCLObject(text2).VCLObject(text10)...VCLObj(tex16).VCLObject(text5)

 

so I would like iterate till the cond if cond satisfy take the text 10 like that

 

I would like to 

did you get my point now ?

thanks and Regards

SivaKartheek sreeram

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Again, to be clear... you haven't mapped ANYTHING.  Terminology matters. :-)

    So... what I would suggest... map everything up to a point where there is a common parent.  Then use the "FindAllChildren" method on that parent to search for and return a collection of all the desired child objects.  That is usually returned as an array.  You can then do a for loop through that array and process each item individually.

    • sivakarthik's avatar
      sivakarthik
      Contributor

      hi Tristaanogre,

       

      At first, even I have used just like you said but, with that I have to define so many times. 

      thats why I thought of recurssion but now I am implementing in different way.

      At first storing those texts values in a dictonary and list. If condition satisfies thenI will use that text into that VCLObject. 

      With that I don't have to redefine again and agin and now its works fine

       

      thanks and Regards

      SivaKartheek Sreeram

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Once you've mapped something once, it never needs to be mapped again... there is your "dictionary" of objects, already built in to TestComplete.

        I guess I'm confused... what problem are you actually trying to solve?