Ask a Question

Testcomplete is slow to performs basics operations.

SOLVED
eykxas
Contributor

Testcomplete is slow to performs basics operations.

Hi everyone !

 

I have an annoying issue with TC since the last update. (15.47.4.7 x64).

Basics operations like Click(), obj.Text = "some string" etc... take a long time to execute. About 3 to 4 seconds.

 

For example I have a very simple login page.

 

it's just a td/tr with some elements (two input, one button)
Searching accross this dom, is really fast for TC. Nearly instantaneous.

this is the code (javascript) : 

in this code almost all lines are executing fast except : input1.Text = login, input2.Text =  password and button.Click().
Before the update (I don't remember the version, maybe 15.41) this code took less than a second to execute, now it take 8 seconds in the best case.

 

 

function login(login = Project.Variables.login, password = Project.Variables.password){
  
  var page = Aliases.browser.pageLogin;   
 
  var input1 = page.Find("ObjectIdentifier", "input_1", 7, false);
  var input2 = page.Find("ObjectIdentifier", "input_2", 7, false);
  var button = page.Find("ObjectType","SubmitButton", 7, false);

  if(input1.Exists){
    input1.Text = login;
  }else{
    Log.Error("input1 not found");
    return false;
  }
  
  if(input2.Exists){
    input2.Text = password;
  }else{
    Log.Error("input2 not found");
    return false;
  }
  
  if(button.Exists){
    button.Click();
    Log.Message("Connection ok");
    return true;
  }else{
    Log.Error("button not found");
    return false;
  }
}

 

 

 
I don't understand why the operations is so long. Thx.

20 REPLIES 20
rraghvani
Trusted Contributor

Usually when this happens, I close TC and clear the browser cache. I also ensure the browser name mapping is correctly defined. Sometimes, using Object Spy tool slows down too. Not sure what the exact issue is.

I've done all that before, no improvement.

eykxas
Contributor

I have found a workaround.

 

This is a total nonsense but... it works.

 

So, I'm searching for an object in the standard way with properties/values (obj.Find or obj.FindAll) then, I extract the full xpath of the object and searching it again via xpath (FindElement).

In this way, the subsequent operations on the object (like Click(), HoverMouse() etc...) are instantaneous. This double search slow down my scripts routines but overall, it works much better than the standard way alone. It seems that when we do an operation like Click(), TC search the object again instead of accessing it directly (at this point TC is really slow). Via xpath, we have no search, so it's always instantaneous.

rraghvani
Trusted Contributor

I've ended running the same code, using TC 15.48.6.7 x64 on our web application which also has a login in page, and it works fine.

rraghvani_0-1675338796505.png

The only delay, is the website being redirected to a login page.

 

 

eykxas
Contributor

yeah I know.  the code is really simple and should work without issue, but, it's not the case in my environment. TC struggle when it has to execute some functions like Click().

rraghvani
Trusted Contributor

If you are still having issues, then log a support call https://support.smartbear.com/testcomplete/message/. Hopefully, that should get your issue resolved quickly.

eykxas
Contributor

yes the issue is still there :

2023-02-09 11_59_02-Window.png

look, 11s to set the first input ! 7s for the second and the button... 

With my weird workaround (double search) the time is acceptable

2023-02-09 12_05_24-Window.png

 

2s for the first input, and less than 1s for the others.

I don't think Smartbear can really help. I can't provide access to the app (confidential and on an independent network) nor video or the "complete" code I'm using. (the code in this thread is a simplified one but the issue are exactly the same).

rraghvani
Trusted Contributor

That's is strange!

 

I guess it will be difficult to diagnose if they can't gain access. I can’t think of any other solutions.

eykxas
Contributor

that's all I can provide. The code isn't clean and redundant but doesn't matter.

 

As you can see, each line works as it should, but when TC sets the text or clicks the button, it takes a long time. At this point, "elementHTML" is already found and visible on the screen.

 

So it looks like the TC engine has a bug.

 

cancel
Showing results for 
Search instead for 
Did you mean: