Forum Discussion

Abhay_Kulkarni's avatar
Abhay_Kulkarni
New Contributor
7 years ago
Solved

TestComplete12.30 utilizes CPU 95% to 100% , so execution is very slower.

Hi Friends,

 

I am facing some issue while executing testcomplete script. I have written script in VBScript.

It takes too much time for every action. for example after loading page it takes time to click on button. Also it takes time to click on menu. I checked playback properties but there is no delay or timeout. I am using page.FindChildByXPath for identifying every web element on page. I checked CPU Utilization while execution it is 95% to 100%.

 

Please let me know if any one face such kind of issue.

 

Thanks,

Abhay Kulkarni.

  • AlexKaras's avatar
    AlexKaras
    7 years ago

    Hi Abhay,

     

    In addition to what was said by Osaid: .FindChildByXPath is the last resort way in TestComplete's world and personally I can recommend to use it only when the web elements on the tested web page have no other identifiers but class name. In all other cases, search using .FindXXX methods provided by TestComplete is more preferable.

    There are at least two reasons in favor of .FindXXX:

    a) .Find is faster than XPath (confirmed by direct measurements);

    b) in some cases, XPath search may return native web element but not TestComplete object (see documentation for more details) and thus you may not be able to use regular methods/properties like .Exists, .Visible, etc. for these native web objects and will have to determine first whether native web or TestComplete's object was returned as a result of XPath search.

2 Replies

  • Hi Abhay,

     

    I have been facing performance issues with different find methods especially in chrome. To filter out try putting a timer or a log message and confirm if  page.FindChildByXPath is the line that is taking time.

    iTime = Timer()
    Set obj = page.FindChildByXpath
    Log.Message "Time taken to find the object: " & Timer()-iTime & " secs"

     

    If Yes, try finding the object by CSS Selectors or Find Method

     

    Regards

    Osaid

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      Hi Abhay,

       

      In addition to what was said by Osaid: .FindChildByXPath is the last resort way in TestComplete's world and personally I can recommend to use it only when the web elements on the tested web page have no other identifiers but class name. In all other cases, search using .FindXXX methods provided by TestComplete is more preferable.

      There are at least two reasons in favor of .FindXXX:

      a) .Find is faster than XPath (confirmed by direct measurements);

      b) in some cases, XPath search may return native web element but not TestComplete object (see documentation for more details) and thus you may not be able to use regular methods/properties like .Exists, .Visible, etc. for these native web objects and will have to determine first whether native web or TestComplete's object was returned as a result of XPath search.