Forum Discussion

jlperez's avatar
jlperez
Occasional Contributor
11 years ago

Any performance issue in Find, FinChild ... funtions family in TC 10?

Hi all,

 

Is there any performance issue regarding the family of methods Find, FindChild, … used for searching GUI objects in a Web application?. To be more concrete, I’m using the following instruction to find a child starting from a parent object in the object hierarchy:



      pChild =  pParent["Find"]("FullName", strChildFullName, 1);



I’m using the FullName property and the third parameter is set to 1 (depth in the object hierarchy till the search will be done). Previously I used the same instruction but with the third parameter set to 200 for example, to search as deeply was necessary. The problem was that it took me a lot of time so I managed to do the same by calling the Find method as indicated above (I gained in performance). All this was in TC 9.31 version.

 

One week ago I upgraded to TC 10, and it seemes to me that the instruction above takes more time than before. I’ve measured the time this way:

     if (GC_Perf_Debug == 1)

      { 

      int_StartTime=Win32API.GetTickCount();

      }     

     

      pChild =  pParent["Find"]("FullName", strChildFullName, 1);

     

     

     if (GC_Perf_Debug == 1)

      {   

      int_StopTime=Win32API.GetTickCount();

      int_res = int_StopTime - int_StartTime;

      Log["Message"]("Time employed (ms) = " + int_res);

      }



And some times it takes around 1500 msec  to execute or even more. This time makes my automated testing too slow.  Is there any issue related to this situation?

 

Any help would be very appreciated, thanks a lot in advance.

JP.
  • If you already have FullName of an object why are you searching for it again?

    You can just make something like that:

    eval(strChildFullName)["Click"]();

  • If you already have FullName of an object why are you searching for it again?

    You can just make something like that:

    eval(strChildFullName)["Click"]();

  • jlperez's avatar
    jlperez
    Occasional Contributor
    Hi Hanya,



    first of all thanks for your response. I have the object fullname property though I haven't accessed the object before. This is because I use a mapping facility which translates the GUI object from a user namespace (the user can give the name that he/she wants to any GUI object) to Test Complete namespace (the name that Test Complete needs to uniquely identify the GUI object in the object hierarchy and then access to its properties and methods). Even if I have the fullname, I haven't accessed the object already.

    I obtain the fullname previously through the object explorer of TC, for every GUI oject I want to include in the automation (now I do it manually but I’m thinking to do it automatically).

    To prevent changes in the fullname property depending on the execution conditions, I use variables that are parsed when the automation is executing (language variables, URL variables, ...). These variables, once parsed, are part of the fullname property that will help Test Complete to find the object in the object hierarchy.

    Anyways, thanks for suggesting the use of eval() function, I’ll consider its use in the future.

    Regards,

    Jose Perez.
  • jlperez's avatar
    jlperez
    Occasional Contributor
    Hi again Hanya,

     

    I’ve been thinking about your suggestion.  I understand that I can use the eval function to access an object even if I have not accessed it before, for example (considering I currently know already the fullname property of the object strChildFullName):

     

    ChildObject =  eval(strChildFullName);

     

    if (ChildObject ["Exists"])

    {

    //Any child object method or property would be accessible here

    pChildObject ["Click"]();

    }

    Else

    {

                //Object doesn’t exist

    }

     

    Here the key for me is the time it takes to perform the instruction:

     

    ChildObject =  eval(strChildFullName);

     

    I’ll check if it works, and if so I’ll measure the time it takes.

     

    Thank you very much again for the idea.

     

    Regards,

    Jose Perez.