Forum Discussion

sivakarthik's avatar
sivakarthik
Contributor
6 years ago

getting objects via recurssion

Hello Community members,

 

I just had a thought acquiriung objects via recurssion. is it possible to do that with test complete ?

 

for example 

obj name texts - function for storing and returning the texts

then I would like to do it recurssively is it possible to do that ?

 

any ideas ? please let me know ?

 

Thanks and Regards

SivaKartheek Sreeram

12 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    > then I would like to do it recurssively is it possible to do that ?

    Recursive code call is a feature of scripting language and thus it definitely can be done in TestComplete.

    Code template is like this:

    function main()

    {

      value = RecursiveFunction(<param>);

    }

     

    function RecursiveFunction(<param>)

    {

      param1 = <ModifyParamAsNeeded(param)>;

      // check if recursion should continue

      if (<ShouldContinueWithRecursion(param)>)

        return RecursiveFunction(<param1>);

      else

        return <param1>;

    }

     

    • sivakarthik's avatar
      sivakarthik
      Contributor

      Dear AlexKaras,

       

      Thank you for your reply, I know about the concept of recurssion and how  to do it also but my question is,

       

      eg. The below is the object 

      Aliases.Process().VCLObject(text).VClObject(text1).VCLObject(text2)

       

      is it possible to do above object mapping via recurssion ?

       

      function for texts

       

      recursion function returs VCLObject(texts)

       

      thanks and regards

      SivaKartheek Sreeram

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        You're already accessing them via Aliases... why would you need to use recursion?  Simply map the components you need to use.