cancel
Showing results for 
Search instead for 
Did you mean: 

FindChildByXpath method is very very slow all of sudden

Highlighted
Occasional Contributor

FindChildByXpath method is very very slow all of sudden

Hello,

 

I've been using FindChildByXpath method for a long time now, but lately I've noticed that this has besome very very slow in finding out the objects. These are the same programs that I've been running for more than 3-4 years. I don't know if this is the chrome version or the TC version or something else. There are some objects for which I have to use this method as there's other option available for custom angular tables. 

 

My TC version: 14.30.3743.7 x64

Chrome version: 80.0.3987.100 (Official Build) (32-bit)

 

Code inside the methods looks like this, but It's just not able to locate the object on the page at all.

 

  // Call the function
  let obj = page.FindChildByXPath("//button[@type='submit']", true);
  // Check the result
  if (!strictEqual(obj, null))
  {
    // If the element was found, click it
    obj.Click();
  }

Any help would be appreciated!

 

Thank you

Al2

 

6 REPLIES 6
Highlighted
Community Hero

Re: FindChildByXpath method is very very slow all of sudden

I'm guessing that the reason for the slowness is the "not found" aspect.  There's atimeout for searching for objects and you may be hitting that time out.  If the code snippet you posted is not returning an object, than it's entirely the case that the XPath may have changed. You might need to rework that code.  I'm guessing that the problem is in Chrome or how Chrom is rendering the web page, not necessarily in TestComplete.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: FindChildByXpath method is very very slow all of sudden

@tristaanogre  Yes..Object search timed out (in 20 seconds), and returning 'undefined' object. I've checked the xpath which seems to be absolutely correct. I can't think of any other reason why this is behaving like that.

 

Thank you

Al2

Highlighted
Community Manager

Re: FindChildByXpath method is very very slow all of sudden

Thank you tristaanogre for your help.

 

Hi @Al2! It looks like you've managed to identify the probable cause of the slowness together with tristanogre here. Were you able to find a way to make it work faster? Please let us know you need more advice from the Community regarding this situation.

 


Sonya Mihaljova
Community and Education Specialist

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!
Highlighted
Occasional Contributor

Re: FindChildByXpath method is very very slow all of sudden

@sonya_m  Not yet. I had  to debug the same program which had been working consistently well for last 3 years.

The xpath is available on the page but the FindChildByXpath keeps returning 'null'. I see that I have a little scope for experimenting because TC would work better with it's native functions. There's a reason why I wanted to use xpath here because TC name mappings doesn't work in every situation esp. angualr custom controls.

 

 

Thank you

Al2

Highlighted
Community Manager

Re: FindChildByXpath method is very very slow all of sudden

@Al2 Thank you for the update. Keep us posted and do not to hesitate to look for more assistance here!


Sonya Mihaljova
Community and Education Specialist

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!
Highlighted
Community Manager

Re: FindChildByXpath method is very very slow all of sudden

Hi @Al2 , any updates? This is highly appreciatedSmiley Happy


Sonya Mihaljova
Community and Education Specialist

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!